This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception question

 
Meg Adal
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
following question is from mock exam
Name the superclass of all exceptions in the Java language.
A. Throwable
B. Exception
C. Error
D. Object
Corrrect answer is A
I thought it should be B as Throwable is parent of class Exception and Error and All exceptions' parent is Exception class
Please correct me if I am wrong
Thanks in advance
Megan
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess : because Exception, being also an Exception, isn't superclass of itself
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't agree more
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a very well written question; where did you find it? Object is also a superclass of all exceptions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic