-->A constructor using private modifier is called private constructor. -->if a constructor is declared as private constructor we can not create object of its class from outside the class. But we can create object of the class inside that class. Usage----------> The private constructor concept is very important in Design pattern. --->if you want to restrict the object creation of a class outside the class then we will declare the class constructor as private.
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!