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
Why method overriding is used?
What is java’s garbage collected heap?
How to display all the prime numbers between 1 and 100
What is methods in java?
What is dynamic binding(late binding)?
What do heavy weight components mean in java programming?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
What is the function of character?
How to sort numbers in java without array?
Can you instantiate the math class in Java?
What is lambda programming?
How can an object be unreferenced?
what are Hostile Applets?
Describe what a thread-local variable is in java?
What are different types of encoding?