GeekInterview.com
Series: Subject: Topic:
Question: 16 of 1118

How can we create object of any class without using new keyword?

Asked by: Nitin Vavdiya | Member Since Jan-2012 | Asked on: Jan 30th, 2012

View all questions by Nitin Vavdiya   View all answers by Nitin Vavdiya

Showing Answers 1 - 5 of 5 Answers
Abhaya

Answered On : Feb 2nd, 2012

Class.forName("class name").newInstance();

Yes  1 User has rated as useful.
  
Login to rate this answer.
nidhi

Answered On : Mar 3rd, 2012

There is also another way of creating object. It is by using double quotes.

  
Login to rate this answer.
Sonia

Answered On : Mar 16th, 2012

Code
  1. obj.clone();

  
Login to rate this answer.
Devapangu Mangaiah

Answered On : Mar 19th, 2012

Using factory method

  
Login to rate this answer.

By using Class.forName,we can create object

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.