user image

Gagan Mishra

Job Interview Skills
English
2 years ago

Question 592. What Is Private Constructor? And It's Use? Can You Create Instance Of A Class Which Has Private Constructor?

user image

Abhishek Mishra

2 years ago

Private constructors are used to prevent creating instances of a class when there are no instance fields or methods, such as the Math class, or when a method is called to obtain an instance of a class. If all the methods in the class are static, consider making the complete class static.

Recent Doubts

Close [x]