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 scavenging?

2 Answers   HCL,


When you inherit a protected class-level variable, who is it available to?

2 Answers  


Which is the best way for keeping the data in XML or SQL server..and why?

8 Answers   Satyam, Infosys,


2. What happened when BO object has been called?

0 Answers   Mphasis,


destructor, Dispose, Finalize - How they relate to each other

1 Answers   Synechron,






Explain about Protected and protected internal, ?internal? access-specifier?

7 Answers  


what is a constructor?

5 Answers   Choice Solutions,


Why do we need interfaces?

2 Answers   HCL,


What is a resource? Provide an example from your recent project.

2 Answers   IBM, Wipro, Logica CMG,


Is goto statement supported in C#? How about Java?

2 Answers  


can a structure used in a class if yes then how.

2 Answers   Synechron,


What is the difference between webgarden and webfarm?

1 Answers   Mphasis,






Categories