how can u create the object with out new operator

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What package is math in java?

533


Is java a virus?

532


What does isempty () do in java?

600


What are three ways in which a thread can enter the waiting state in java programming?

684


What are namespaces in java?

525






What does opcode mean?

538


Where will it be used?

1507


When should I use a singleton?

557


What do you know about java?

523


What is the advantage of functional interface in java 8?

523


What is the difference between a loader and a compiler?

526


What is the purpose class.forname method?

559


What are loops in java? What are three types of loops?

550


What is the difference between form & report?

589


Write a program to print fibonacci series

612