When compiler adds a default constructor to a class?

Answers were Sorted based on User's Feedback



When compiler adds a default constructor to a class?..

Answer / chandana

The compiler adds a default constructor to a class when no
constructor are specified by the programmer.

Is This Answer Correct ?    10 Yes 0 No

When compiler adds a default constructor to a class?..

Answer / sitaram

when ever compile the class,First compiler check the any
type of constructor is available or not in that class? if
it is not available. compiler will automatically create the
default constructor.

Is This Answer Correct ?    3 Yes 1 No

When compiler adds a default constructor to a class?..

Answer / abhay k pandey

When there in no explicite parameterless constructor
written for any class. C# compiler calls the default
constructor and initializes fields with zero, false and
null values.

Is This Answer Correct ?    1 Yes 0 No

When compiler adds a default constructor to a class?..

Answer / romeo

when the object of that class is created with no parameters
passed.

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More C Sharp Interview Questions

Constructor to an arbitrary base constructor?

0 Answers  


What is the difference between overriding and overloading in systemverilog?

0 Answers  


What do you mean by winforms in c#?

0 Answers  


Where test director stores its data ? Database ,Local file etc...? I need to read this data from Visual Studio 2005 c# client. Regards

0 Answers  


Why do we need private constructor in c#?

0 Answers  


What are three test cases you should go through in unit testing?

1 Answers   Siebel Systems, Wipro,


What is a console?

0 Answers  


How can I check the type of an object at runtime?

0 Answers  


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

3 Answers  


Why multiple Inheritence is not used in C#?

8 Answers   Symphony,


What is the difference between and xml documentation tag?

0 Answers  


What is a dynamic assembly?

0 Answers  


Categories