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


Please Help Members By Posting Answers For Below Questions

Why is stringbuffer called mutable?

561


How do you insert a line break?

490


what is deadlock? : Java thread

519


How many techniques can be employed to create a string object?

551


Explain about java sdk?

574






Does java map allow duplicates?

486


What does arrays sort do in java?

536


What are multiple inheritances? Is it supported by java?

458


What does regex mean?

561


What is a type parameter in java?

526


What is getclass () getname () in java?

673


How do you sort in descending order in java using collections sort?

488


What is a class variable?

562


When super keyword is used?

587


How do you write a good declaration?

487