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 is meant by interface?
How many bits is size_t?
If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?
Does chrome use java?
What happens if an exception is throws from an object's constructor?
What is difference between hashset and hashmap in java?
What do you mean by an interface in java?
Can list contain null in java?
Can you call a method in a method?
explain autoboxing in java?
What is the use of list in java?
Can we assign null to double in java?
Is ++ operator thread-safe in java?
What does mean in regex?
What is a boolean used for?