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

How to set on/off a group of indicators in a single statement?

1371


10.Define filters,binary to hexadecimal,hexadecimal to decimal?

1510


I have try to write a record in a TDQ from a fle.... what are the steps to do... can anybody plz come with a solution

2205


What is the first message line that any language learning prints on the screen? and why?

1677


Define distributed queries. can you explain me as soon as possible

1622






hi i am jyoti i have done sap training in sd and master degree in economics have 2 year exp as enduser in (gdms)and 1 year as sd consultant.as contract basis now what i can do for getting job in it industry

1650


How to call a C++ function which is compiled with C++ compiler in C code?

787


what is session state?

1514


When we have two versions of the dot net installed how does the compiler know which version of DLL it has to select to an application.

1420


If i have a dataset queried from Sql and I would like to insert the dataset into a specific node in an xml document how do I do this

1696


what is delegate and how works delegate and event.

1765


WHat is execution in manual testing and when will we start execution and what language we use in execution

1478


what is the difference between Windows application and Unix application?

2152


How can recruiter justified that the candidate is expert in Algorithm and datastructure for Software product development ?

1497


What is dialog programming?

1575