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

Can constructor throw an exception?

Asked by: naveen.chinthala | Member Since Feb-2012 | Asked on: Feb 9th, 2012

View all questions by naveen.chinthala   View all answers by naveen.chinthala

Showing Answers 1 - 4 of 4 Answers

Yes, constructors can throw an exception. However, please note that, if a superclass constructor throws a checked exception, then if any subclass constructor calls that superclass constructor must throw the same exception, or a broader exception.

  
Login to rate this answer.
sampra

Answered On : Mar 6th, 2012

View all answers by sampra

yes if super class is throwung Exception then sub class will throw Throwable

  
Login to rate this answer.
Jacqui

Answered On : Aug 13th, 2012

How can that be if constructors are not inheritable?

  
Login to rate this answer.
avinash

Answered On : Sep 26th, 2012

yes,if exception related statements are there in constructor then it automatically throws an exception,if that is un-checked.

  
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.