what is private constructor?what are the uses of writing
private constructor in our program?
Answer Posted / neha
we can not create instance of object with new operator.if u
do not want the class to be inherited then we declare the
construtor as private when we used Private Construtor
Static metods are used this construtor are also used for
creating singleton object
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What are decalarations?
Can a class be a super class and a sub-class at the same time? Give example.
Can finally block be used without a catch?
Does java support multiple inheritance or not?
What is the purpose of static methods and static variables?
Explain the differences between static and dynamic variables?
What are selection structures?
When would you use a static class?
What is difference between core java and java ee?
What is the final blank variable?
Can we serialize singleton class?
What causes memory leak in java?
Is java a virus?
what is the difference between preemptive scheduling and time slicing? : Java thread
What is function and its uses?