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
How do you write a conditional statement?
What are untrusted applets?
Is arraylist dynamic in java?
Why is multiple inheritance not supported in java?
What is token in java?
What are access specifiers in java ?
When to use runnable interface vs thread class in java?
Which list is sorted in java?
What is the difference between static (class) method and instance method?
What is the declaration statement?
How many ways can you break a singleton class in java?
What is static in java?
Explain constructors and types of constructors in java.
Which category the java thread do fall in?
What package is math in java?