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
How do I find and replace in word?
What's the default access specifier for variables and methods of a class?
How do I type unicode?
What is an immutable object? How do you create one in java?
Can substring create new object?
What are wrapper classes in java?
What are the methods used to implement for the key object in the hash map?
How do you reverse a list?
How to create an immutable class?
What is constructor chaining in java?
How does arraylist size increase in java?
Is linked list a linear or non-linear data structure?
How listener identify that the event came from a particular object?
What are the advantages of exception handling?
What’s the difference between the methods sleep() and wait()?