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 is difference between string and stringbuffer?
What are benefits of java?
What is the function of character?
Can we create a class inside a class in java?
What is meant by singleton class?
What is the difference between a method and a function in alice?
What are the different ways of implementing thread? Which one is more advantageous?
How do you identify if jvm is 32-bit or 64-bit from java program?
How do you add spaces in java?
How do you sort in ascending order in java?
What is use of static method?
What is a method signature java?
Can we override the static methods?
How are variables stored?
Why Java doesn’t support multiple inheritance?