Can we have private constructor in java??
Yes we can.. Mainly used to make a class singleton...
Yes, we can
Yes we can have a private constructor in java... If you want to use a private constructor in outside the class then u should have a public constructor in that the private constructor should be called
Or when the constructor is called from a public static method.
Yes we can have a private constructor but it is useful only then if the main method is in the respective class itself otherwise we will not be able to construct the object.