• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception handling: what is this book trying to say here?  RSS feed

 
Iarla O'Riada
Ranch Hand
Posts: 87
Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm studying for the OCA I exam and in Mala Gupta's book she says: "Subclasses of the class java.lang.Exception are categorized as checked exceptions
if they are not subclasses of class java.lang.Runtime."

Now, I've drawn a map out and RuntimeException extends Exception which extends Throwable. Runtime is a seperate class which extends Object so that statement makes no sense to me as something that extends RuntimeException simply can't extend Runtime. Or am I missing something?

Thanks & regards,
Iarla
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it says that literally in the book, then that's an error in the book.

It should have said: "... if they are not subclasses of class java.lang.RuntimeException".
 
Iarla O'Riada
Ranch Hand
Posts: 87
Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jesper, that matches the class diagrams I've drawn out. I've contacted the author with the errata.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!