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 java Applet?
What is difference between static class and normal class?
What are the ways to instantiate the class class?
What is Recursion Function?
Is map ordered in java?
Can an integer be a string?
What are advantages and disadvantages of OOPs?
What is a private class in java?
How big is a 32 bit integer?
What is the different types of functions?
What is the purpose of sizeof operator?
Is boolean a wrapper class in java?
What is difference between final and immutable?
What is java autoboxing?
What are different type of exceptions in java?