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 difference between path and classpath variables?
What is composition in java?
How will you print number in reverse (descending) order in BST.
How do I enable java in safari?
Is 0 a real number?
What is meant by object oriented programming – oop?
What is the maximum length of a url?
What is static class
What is the difference between double and float variables in java?
What is stack class in java?
difference between byte stream class and character stream class?
List out five keywords related to exception handling ?
What is difference between string and stringbuffer?
What is the purpose of an interface?
Can we force garbage collector to run ?