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
Explain polymorphism citing an example.
What is the purpose of the file class in java programming?
How do you convert boolean to boolean?
What is dot operator?
Is there any tag in htm to upload and download files?
What is the difference between JDBC 1.0 and JDBC 2.0?
What about main() method in java ?
What is singleton class and how can we make a class singleton?
Is null a string or object in java?
What are the 6 boolean operators?
Is there a sort function in java?
What are the advantages of arraylist over arrays?
What are the different ways of implementing thread? Which one is more advantageous?
Can you give names of Container classes?
What are the main differences between the java platform and other platforms?