• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

another True or False statement that confuse me

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Overriding method cannot throw any exceptions that are not thrown by the overridden method.

(T/F)

the answer is false:
with this explanation

It can throw any exception as long as it is a subclass of any of the exceptions thrown by the overridden method. It can, of course, also be a subclass of RuntimeException.



the "as long as" statement in the explanation here, to me, seems to contradict the word "any" in the questioning statement above.


i think the statement would be alot more clear if it was like this:

Overriding method cannot throw any new checked/broader exceptions that are not thrown by the overridden method.

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the question were what you have stated will that be true or false ?
 
Max Vandenburg
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it would be true :roll: had i edit the above statemnent to any new or broader checked exceptions (which was what i meant in the first place)instead of any new checked/broader
 
Praveen Babu
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The original answer to the question was false and with your new statement it became true.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic