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

When we delete logfiles such as screenshots how does it affect the ldf file? Ive seen huge change while adding screenshots in the ldf file but a very minor one deleting them.Please Explain

1655


THE CHANNEL IN DATA COMMUNICATION CAN BE?

1797


Explain three modes in which files can be accessed from python program

1543


in cobol,wat is the difference in using 'set index in occurs clause' ....and 'occurs depending-on clause'

2013


hai i am mca 2009 fresher.please tell me which certification helps me to get an IT job faster which institute is good in hyderabad.please mail me to prasanna.1856@rediff.com

1756


how to check single or double byte in struts

1811


purpose of abstraction and interface

1787


Wrtite a JCL for sorting a file with start from 36 postion lenth 9 excluding a num eq to 98768. for 3 marks mainframe

1687


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

2470


Which method protects back button to retrieve old value from previous page in Struts.

1662


I want sample papers for NIC Examination. Plz send them to my mail Id das.neelam@gmail.com . Plz send it today, tomorrow i've the exam.

1808


Q2. A memory location has physical address D5687h. Compute: a. The offset address if the segment number is D445h. b. The segment number if the offset address is B577h.

1899


What are the tasks performed by a Team Lead

2586


What is %Type,%Rowtype?

2034


What is the meaning of client-server application. The purpose of Client-Server Application. with description.

1931