Question 177Asked in DSSSB TGT Computer Science, 25 Jun 2023, Shift 1 (8:30 AM)Which of the following is FALSE with reference to constructor in C#.NET?
- AIt can have a return type.
- BAll classes have constructors by default.
- CConstructor name must match the class name.
- DThe constructor is called when the object is created.
Show answerHide answer
Correct answer: (A) It can have a return type.
Explanation
A constructor in C# has no return type, not even void, so A is false. It has the class name and is called when an object is created.