what is private constructor?what are the uses of writing
private constructor in our program?
Answer Posted / nandhakumar
We use private constructor in singleton class:it ve only one
instance,in this case we generally used to ve one static
method (getInstance()).While we cal this method first time
it use private constructor to create instance.next time this
method returns the existin instance..
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the special characters?
What is the difference between C++ and Java and your preferences?
Can we sort hashset in java?
What are three ways in which a thread can enter the waiting state in java programming?
What do you mean by constant time complexity?
how to create multithreaded program? Explain different ways of using thread? : Java thread
What is difference overloading and overriding?
How is tree Mirroring implemented?
Explain about wait() method?
What are measurable parameters?
Does variable declaration allocate memory?
What is string [] java?
What is the Scope of Static Variable?
What is pass by value?
How do you override a variable in java?