Can constructor throw an exception?

Questions by naveen.chinthala   answers by naveen.chinthala

Showing Answers 1 - 12 of 12 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.

  Was this answer useful?  Yes

Jacqui

  • Aug 13th, 2012
 

How can that be if constructors are not inheritable?

  Was this answer useful?  Yes

avinash

  • Sep 26th, 2012
 

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

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions