What do constructors do in c#?



What do constructors do in c#?..

Answer / Deepak Singh Yadav

Constructors are special methods in C# that are used to initialize objects. They have the same name as the class, and by default they don't have a return type or access modifier (public). When an object is created, the constructor runs automatically to set initial values for the object's properties.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Is std :: string null terminated?

1 Answers  


Is and as in c#?

1 Answers  


what is the purpose of Interfaces?

7 Answers   HCL,


What does assert() do?

1 Answers   Rolta,


Is lazy t thread safe?

1 Answers  


Distinguish between the Debug class and Trace class with its functionality?

1 Answers   Siebel,


Can we override constructor in c#?

1 Answers  


What is property c#?

1 Answers  


how many catch we can write in thye program?

2 Answers  


What are some of the commonly used commands in sqlcommand?

1 Answers  


Which control cannot be placed in mdi?

1 Answers  


What does console writeline do?

1 Answers  


Categories