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
What do you mean by boolean?
What is the structure of java?
What are the important features of Java 11 release?
Why arraylist is not synchronized in java example?
What classes of exceptions may be caught by a catch clause in java programming?
What is the purpose of a volatile variable?
What do you mean by stream pipelining in java 8?
What is binary tree in java?
Which is faster call by value or call by reference?
What is the do while loop syntax?
What is threaded programming and when is it used? : Java thread
What is the difference between java applets and applications?
What is the purpose of using javap?
What is the difference between length and length() method in java?
Is space a char?