Can a Java constructor be private?

Last Updated :
Discuss
Comments

Can a Java constructor be private?


No, it must be public.

Yes, but the class cannot be instantiated outside the class.

Yes, and it can be accessed from anywhere.

No, Java does not allow private constructors.

Share your thoughts in the comments