What are the other ways to create an object with out calling
new keyword in java?

Answers were Sorted based on User's Feedback



What are the other ways to create an object with out calling new keyword in java?..

Answer / bala

using in class.for name method
myobject obj=(my object)class.for name("sub in.rnd.my object").new instance();

Is This Answer Correct ?    1 Yes 0 No

What are the other ways to create an object with out calling new keyword in java?..

Answer / sumitpalsingh

1.by using newInstance();,but before this we have to load the class by using Class.forName();

myobject obj=(my object)class.for name("sub in.rnd.my object").new instance();

2.By using clone();
3.BY using DeSerialization.
ObjectInputStream inStream = new ObjectInputStream(anInputStream );
MyObject object = (MyObject) inStream.readObject();

4.By using String class .

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

sample and simple coding where we get?

0 Answers   IBM,


What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?

2 Answers  


why rownum=1 works properly but not rownum=>2,=>3 etc.

0 Answers   Oracle,


Is class is a abstract datatype in java?

0 Answers  


how to data grid use in data bind?

0 Answers   HCL,






what is difference between object oriented programming structure and object oriented programming system?

0 Answers  


what is the software to run the GSM gate opener program

0 Answers  


This is the portal and portlet interview question API: is JSR 168 API Server: is ibm web sphere portal server6.0 IDE: is RAD 7.0 Question:In normal struts what is the actionservlet? Ans:org.apache.struts.action.ActionServlet. But What is the actionservlet in strutsportlet?

1 Answers   CTS, IBM,


how do we provide security for web services

0 Answers  


can we use commit,rollback in triggers and how?

0 Answers   Sierra Atlantica,


how will you code the subfile which is in editing mode (multiple case subfile)?

0 Answers   Bank Of America,


Difference between delegates and Events?

0 Answers  


Categories