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?

  1. AIt can have a return type.
  2. BAll classes have constructors by default.
  3. CConstructor name must match the class name.
  4. 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.

From DSSSB TGT Computer Science PYQ, 25 Jun 2023, Shift 1 (8:30 AM)

This is question 177 of DSSSB TGT Computer Science PYQ, 25 Jun 2023, Shift 1 (8:30 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.