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
Can we declare an interface as final?
What is return code?
what is the difference between thread and runnable types? : Java thread
What is the difference between path and classpath variables?
What are different ways of object creation in java ?
What do you mean by static variable?
Is java hashset ordered?
How do you check if an arraylist is not empty?
Why is string class considered immutable?
Why we override equals() method?
Can we extend private class in java?
What happens to a static var that is defined within a method of a class?
what is the difference between a threads start() and run() methods? : Java thread
Why set is used in java?
How would you dynamically allocate memory to an array?