Can a program run without declaring constructor?
Answers
Answered by
0
It can be used to initialize the objects to desired values or default values at the time of object creation. It is not mandatory for the coder to write a constructor for a class. If no user-defined constructor is provided for a class, compiler initializes member variables to its default values.
Answered by
1
Answer: Yes it is possible. It is not compulsory to declare a constructor for run a class.
Explanation:
Similar questions
English,
4 months ago
English,
4 months ago
Biology,
10 months ago
CBSE BOARD X,
10 months ago
Math,
1 year ago