Consider the following pieces of C# code:

a. interface I1 {/*......*/}
interface I2 {/*......*/}
struct Point : I1,I2 {/* ..... */}

b. struct Book{
int bookId;
struct Book b;
}

c. using M=Mystruct;
struct MyStruct{
int id;
}
class MyClass{
static void Main(string[] args){
M m = new M();
}
}

d. struct Sample{
Sample ref x;
}

Which of the above are correct?
Choose one of the options below.
a, c and d are right
a only right
a and c are right
d only wrong
None of the listed options




Answers were Sorted based on User's Feedback



Consider the following pieces of C# code: a. interface I1 {/*......*/} inte..

Answer / niloy roy

Only a is the right

Is This Answer Correct ?    1 Yes 0 No

Consider the following pieces of C# code: a. interface I1 {/*......*/} inte..

Answer / sarang

a and c are right.

Is This Answer Correct ?    1 Yes 2 No

Consider the following pieces of C# code: a. interface I1 {/*......*/} inte..

Answer / b2balaji

shall u give reason for this answer?

Is This Answer Correct ?    0 Yes 2 No



Post New Answer



More C Sharp Interview Questions

what is the lifespan of the items stored in viewstate ?

4 Answers  


What?s different about switch statements in C#?

2 Answers  


What are the Different kinds of methods?

4 Answers   Wipro,


What?s an abstract class?

4 Answers   NIIT,


Hi all,I am the beginner. Please tell use of finally block.

6 Answers   IBM,






Which is algorithm is used to Manage the Memory in .net ??

7 Answers   TCS,


int i,string s, String s1 Which is valuetype which is refrence type.

6 Answers   Synechron, Sytel,


Indexers in c#?

8 Answers   TCS, Microsoft, Intaglio,


What does virtual keyword mean ?

6 Answers   TCS,


What is ENUM?

10 Answers   TCS, Wipro, YeshTech,


if we are updating a database using thread, and mean while application crashes or thread being aborted then what will happen in Database? Rollback or Database will be updated? Please explain with different scenario.

0 Answers  


Why is it a bad idea to throw your own exceptions?

4 Answers  






Categories