what is private constructor?what are the uses of writing
private constructor in our program?
Answer Posted / christian
a common use for a private constructor is to implement the
singletton pattern, which uses a public member variable of
the same type of the class which is defined. A public
getInstance() method uses this private constructor
| Is This Answer Correct ? | 13 Yes | 6 No |
Post New Answer View All Answers
Discuss about garbage collector in Java.
How do I know if java is installed?
What is the old name of java?
What is the difference between == and === javascript?
What is the purpose of a default constructor?
What do you mean by singleton class in java?
How to create an interface?
Why volatile is used in java?
What does string intern() method do?
What is run time allocation?
What are the two main uses of volatile in Java?
What is default locale java?
What is local declaration?
What is the maximum size of a string in java?
What is Recursion Function?