how can u create the object with out new operator

Answers were Sorted based on User's Feedback



how can u create the object with out new operator..

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

how can u create the object with out new operator..

Answer / bindhu

As my opinion, we can create object of String using 2 ways:
String s=new String("java");
String s="java";

in Other way ,we can clone an object,that will create a
new copy of an object.

or using Class.forName();( Not Sure....)

Is This Answer Correct ?    6 Yes 1 No

Post New Answer

More Core Java Interview Questions

Which One is optimal to choose ? Syncronized hash map or Hash table with single thread model? How can a hash map syncronized with out using syncrozed blocks in programm?

3 Answers   Four soft,


how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)

0 Answers   Infosys, TCS,


Can a class be a super class and a sub-class at the same time? Give example.

1 Answers  


What is an 8 bit word?

0 Answers  


Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.

2 Answers   iGate, Seed Infotech,






Explain implementation and how is it different from conversion?

0 Answers   Aricent,


What is the difference between ArrayList and Vector? which one is better in Java

0 Answers   SkillGun Technologies,


What is return in java?

0 Answers  


What is the generic function?

0 Answers  


Does chrome use java?

0 Answers  


What is parsing in java?

0 Answers  


What are the main concepts of oops in java?

1 Answers  


Categories