what is the use of declaring constructor as private?
Answer Posted / anshul
A private constructor is a special instance constructor. It is commonly used in classes that contain static members only. If a class has one or more private constructors and no public constructors, then other classes (except nested classes) are not allowed to create instances of this class.
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Is char a method in java?
What does string intern() method do?
What steps are taken when the OS shifts from one-thread execution to another?
Is 0 a real number?
What do heavy weight components mean in java programming?
Does java arraylist maintain insertion order?
What is the byte order of byte buffer?
Explain what pure virtual function is?
What is the use of a conditional inclusion statement in Java ?
Is static a singleton?
What do you understand by the bean persistent property?
What is private static in java?
What do you mean by collectors in java 8?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?
Convert a BST into a DLL and DLL to BST in place.