Exception

When super class method throws exception then subclass also throws the same Exception, which will compile?

Questions by sunithamule

Showing Answers 1 - 4 of 4 Answers

dev

  • Dec 11th, 2011
 

No, When super class method throws exception then subclass does not throws the same Exception

alin20_84

  • Feb 14th, 2012
 

Here foo can skip adding throws NullPointerException because is an unchecked exception
class SupSub extends Super {

void foo()throws NullPointerException

{

System.out.println("SupSub");

}

}

  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