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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Any real time example of O2C process from taking order till creating invoice.

2103


what is session state?

1714


what are the advantages of sap on other software ?

1920


what is the work of 1tier,2tier,&ntier? Plz Explain it!

2223


What do you understand by modular programming?

877


diffrence between oracle apps , .NET , SAP

1830


how to work search engine? plz detail answer me.

1672


5. Which of the following can you do with DB2 Express- C? Query databases with SQL Query databases with XML using XQuery and XPath Use SQL in Xquery and Xquery in SQL All of the above

2360


in a VB application, where the data will be stored after manipulation? what is the syntax for that?

2031


Write a program to find factorial of a number using functions

1463


how to convert the data from HTML file to SAS dataset?

2407


What ports must be open for DCOM over a firewall? What is the purpose of Port 135?

7522


Need provab technical test questions

2597


what is best way to create a Thread class & why?

1837


what is the BAM? where we can use it in BizTalk server?

1556