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

What is the Super Class of Exception in java?

11 Answers   Andesa Services, Benchmark, CitiGroup, CMC, Evergent, KOT Systems, Value Labs, Vijay infoart Solutions,


how many languages .net is supporting now?

2 Answers  


Can anyone provide as400 training material or any institute in bangalore for as400 training

10 Answers  


What does this useful command line do? tasklist /m "mscor*"

1 Answers  


How to display questions one by one in jsp and I wants to store the answers in my database?

0 Answers  






i want to insert textbox value to sql db. i have only one text box but store four values. ple give any one give sample code in asp.net c#..

1 Answers   Concentrix,


1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?

0 Answers   HTC,


Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number

0 Answers   Amazon,


how to avoid java script validation in client side validation?

2 Answers  


hi friends i am ravi here , i have one problem at starting at the interview that is i have my 3+ it(java) years experiance profile so if i attend the interview interviewer ased me tel me about your profile so i not able to explain because i dont knw where to start and where to end and i dont know what i should tel and what i shouldnot tel .....so can any body please clear m doubts clearly.............please help me friends,i am awaiting for friends reply please.............

2 Answers   TCS,


how we can call xml file in java file using Android platform?

2 Answers   TCS,


what will we require to build project with the help of oracle

0 Answers  


Categories