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
Why java strings are immutable in nature?
How do you define a parameter?
What does yield method of the thread class do?
'A class is a template for an object' explain this statement.
What are thread local variables?
What does the exclamation mark mean in java?
What is the difference between this() and super() in java?
What is assembly language?
What is jit compiler in java?
Why hashmap is used in java?
What is skeleton and stub? What is the purpose of those?
Can we inherit a class with private constructor?
what type of questions asked for barclays technologies pune please send urgent
What is the difference between logical data independence and physical data independence?
What are the differences between Java 1.0 and Java 2.0?