• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception Inheritance in ExamLab  RSS feed

 
Saurabh Vohra
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code is from Exam lab 6




I have few doubts 1) i learned that your parent class must throw broader exception then your child class As in case of class AbsA play() method is throwing checked exception and when this method is inherited to AbsB class is implicitly throwing the RuntimeException. How it is possible?

2) Moreover at line 2 , the inherited method is with abstract keyword. Is it possible?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope that you are aware that RuntimeException is non-checked and is implicitly thrown during Runtime should any runtime errors happen! As long as you do not provide any concrete implementation of your method, it needs to be declared abstract!
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!