The Question : What is the need of a constructor in OOP? Also write one feature of a constructor.
Solution for the question :
A special method member called the constructor method is used to initialize the data members of the class.
Feature:
The constructor has the same name as the class, has no return type, and may or may not have a parameter list.
Or
Whenever a new object of a class is created, the constructor of the class is invoked automatically.
The correct answer to the question is researched by our moderators and shared with you. You can give feedback by commenting for the answers you think are wrong.