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 is the unit of plancks constant?
Where is stringbuffer stored?
What is stack explain?
What is the use of static class?
What is meant by oops concept in java?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
Explain about interthread communication and how it takes place in java?
Can a class have multiple constructors?
What are the main features of java?
Write a program to print count of empty strings in java 8?
State differences between C and Java?
Why java is made?
Explain about the performance aspects of core java?
Is it possible for yielded thread to get chance for its execution again ?
How big is a 32 bit integer?