how can u create the object with out new operator
Answers were Sorted based on User's Feedback
Answer / 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 |
Is null a string?
How can a class be accessed, If no access modifiers are declared?
How hashset works internally in java?
Can we have 2 main methods in java class?
What are wrapper classes?
Why java does not supports multiple inheritance?
What best practices should you follow while writing multithreaded code in java?
What is the declaration statement?
what is optional in java 8?
What is string in java is it a data type?
How do I compare two strings in word in java?
Name few java util classes introduced with java 8 ?