A constructor in java is a special type of method that is used to initialize an object.
The Java constructor is invoked during the creation of the object. It builds values, that is, provides data for the object, so it is known as a constructor.
But he does not have a return type, I am afraid that your mentor is mistaken in this matter, repeat it with him.
class Car{ Car() { System.out.println("Car is created"); } public static void main(String args[]) { Car c=new Car(); } }
user8453691
source share