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 |
What does super()represent, and how is it used in Java?
What is an example of character?
What are the three parts of a lambda expression?
What is starvation?
What are scriptlets?
Why destructor is not used in java?
Any one can explain how the inerface uses in java. give with example.
Explain aggregation in java?
How the interruptible method gets implemented?
What are "class access modifiers" in Java?
what is the difference between yielding and sleeping? : Java thread
Why there is no call by reference in java?