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
What will be the output of round(3.7) and ceil(3.7)?
What is meant by data hiding/encapsulation?
What is the use of object and class classes?
What is a null check?
What is r * in math?
What is the difference between preemptive scheduling and time slicing in java programming?
How do you check whether the list is empty or not in java?
Explain the use of volatile field modifier?
Why is a constant variable important?
How do you compare two strings lexicographically?
Tell me about your ability to work under pressure
Is class forname reflection?
Can static method access instance variables ?
What is the difference between class & object?
Is double bigger than float?