The main use of constructors is to initialize the private fields of the class while creating an instance for the class . When you have not created a constructor in the class, the compiler will automatically create a default constructor of the class.
The main use of constructors is to initialize the private fields of the class while creating an instance for the class . When you have not created a constructor in the class, the compiler will automatically create a default constructor of the class.