Question 96Asked in BPSC TRE 2.0 (2023) Computer Science Class 11-12A constructor is called whenever
- Aan object is created
- Ba class is created
- Ca class is declared
- DMore than one of the above
- ENone of the above
Show answerHide answer
Correct answer: (A) an object is created
Explanation
A constructor runs automatically each time an object of the class is created, and it initialises that object. Declaring a class does not call it.