How to create an instance of a class if the class has
private constructor?
Answer Posted / krishnanv
The above answer is perfectly ok only one thing missing i.e
the getObj() method must be static, then only we can call
directly without instantiating that class object.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How many characters is 2 bytes?
Is special character in java?
What are the types of methods in java?
What are wrapper classes in java?
Can inner class have constructor?
What are the 4 types of research methods?
What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?
What do you understand by looping in java? Explain the different types of loops.
What is a war file?
What does a za z0 9 mean?
What is Enum in Java?
What does nextint () do in java?
State the significance of public, private, protected class?
Explain about map interface in java?
How do you use parseint in java?