There are basically three types of constructors in Java.
1. Default constructor: This constructor is without any parameter and invokes every time you create an instance of a class (object). If a class is an Employee, then the syntax of the default constructor will be Employee().
2. No-arg constructor: As the name implies, a constructor without any argument is called a no-arg constructor.
3. Parameterized constructor: Constructor with a number of parameters is called a parameterized constructor. You are required to provide arguments, i.e. initial values with respect to the data type of parameters in that constructor.
Posted Date:- 2021-09-29 23:51:36