what is the use of private constructor in core java?
Answer Posted / rakesh
Private constructor can be used if we do not want any other
class to instantiate the class. This concept is generally
used in Singleton Design Pattern. The instantiation of such
classes is done from a static public method.
| Is This Answer Correct ? | 54 Yes | 3 No |
Post New Answer View All Answers
Is space a char?
What is the r character?
Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?
What is thread synchronization in java?
Which collection is ordered in java?
How we create object in copy constructor?
Explain importance of throws keyword in java?
What is a dynamic array in java?
Which one of the following suits the description of a string better: derived or primitive?
What does java edition mean?
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?
What does sprintf return?
What is Java Reflection API? Why it’s so important to have?
What are features of java?
What is meant by bytecode?