How can u create the Object of class Without using "New"
opertor?
Answer Posted / mohan reddy
In 3 ways we can able to create object without using "new"
operator.
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 ? | 38 Yes | 7 No |
Post New Answer View All Answers
What is an array in java?
What is the simpletimezone class in java programming?
Is java based on c?
Why do we declare a class static?
What is a parameter in a function?
What was java originally called?
What's the difference between int and integer in java?
Explain naming conventions for packages?
What is variable in java?
Is a boolean variable?
What do you understand by overloading and overriding in java?
Can an interface extend another interface?
Why set do not allow duplicates in java?
What is the difference between a checked and an unchecked exception?
Explain the purpose of garbage collection in Java?