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
What is runtime polymorphism or dynamic method dispatch?
Why 1 is not a prime number?
What is final method in java?
What are different access specifiers in java?
How do you use wildcards?
What are the different ways of implementing thread? Which one is more advantageous?
What is the use of static class?
Can we override the static methods?
Which collection is ordered in java?
What is class??
Why we used break and continue statement in java?
5 Coding best practices you learned in java?
Define array. Tell me about 2-D array.
What is the main use of generics in java?
What is "this" keyword in java? Explain