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 do you convert bytes to character in java?
How destructors are defined in java?
Is integer a class?
Difference between stack and queue?
What is the default value of the local variables?
Why we used vector class?
What is the difference between keyword and identifier?
How do you compare two strings lexicographically?
Which package is imported by default?
Define the term string pool?
What is nan inf?
What are the important features of Java 11 release?
Where is core java used?
What is java object name?
What access modifiers can be used for variables?