Answer Posted / md. abid hossain
In 3 ways..
1)Using a Static Factory Method
ABC.getInstance();
2)Using newInstance() method...
class A=(A)Class.forName("A").newInstance();
3)Using clone() method.
Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
What are parsing rules?
What exceptions occur during serialization?
How to make a class or a bean serializable?
Can I uninstall java?
What is the benefit of inner classes in java?
Why is the singleton pattern considered to be an anti pattern?
List the interfaces which extends collection interface?
What is append function?
Why char array is favored over string for the storage of passwords?
What do you understand by casting in java language?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
How can you handle java exceptions?
Can you extend singleton class?
How to write custom exception in java?
What are the features of java?