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

What do you mean by boolean?

583


What is the structure of java?

515


What are the important features of Java 11 release?

591


Why arraylist is not synchronized in java example?

477


What classes of exceptions may be caught by a catch clause in java programming?

709






What is the purpose of a volatile variable?

561


What do you mean by stream pipelining in java 8?

746


What is binary tree in java?

542


Which is faster call by value or call by reference?

513


What is the do while loop syntax?

561


What is threaded programming and when is it used? : Java thread

545


What is the difference between java applets and applications?

574


What is the purpose of using javap?

628


What is the difference between length and length() method in java?

656


Is space a char?

541