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
Can you explain the meaning of aggregation and composition
How do you create a bulleted list?
Is it possible to override private or static method in java?
What are the different types of collections in java?
What does void * mean?
How java uses the string and stringbuffer classes?
What are the differences between throw and throws?
How can I right-justify a string?
Is a boolean variable?
Explain the advantages of packages in java?
Is minecraft 1.15 out?
What is sorting in java?
Explain the features of java?
What is command line argument
How do you sort objects in java?