how can u create the object with out new operator
Answers were Sorted based on User's Feedback
Answer / 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 |
what is Thread?
What is method overriding in java ?
What are different types of control structures?
What does += mean in java?
Can we start a thread twice in java?
I have a String s = java; What is the output when I say s.replaceAll('j', 'k'); Also what is the value of s after replacing?
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
What is bytecode in java ?
Define immutable object?
Is upper case in java?
Explain creating threads by implementing runnable class?
What's the purpose of using break in each case of switch statement?