What is the constructor and how many types of constructors are used in Java?

The constructor is a method used to initialize an object. A normal java method has return type but the constructor does not have any explicit return type. It is called during the object creation time.

There is two type of Constructors - Default or no-arg Constructor, Parameterized Constructor.

Suggest An Answer

No suggestions avaliable!

Related Interview Questions