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
Why is stringbuffer called mutable?
How do you insert a line break?
what is deadlock? : Java thread
How many techniques can be employed to create a string object?
Explain about java sdk?
Does java map allow duplicates?
What does arrays sort do in java?
What are multiple inheritances? Is it supported by java?
What does regex mean?
What is a type parameter in java?
What is getclass () getname () in java?
How do you sort in descending order in java using collections sort?
What is a class variable?
When super keyword is used?
How do you write a good declaration?