jQuery in Action, 2nd edition
The moose likes Ranch Office and the fly likes bug in rule roundup #231 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » This Site » Ranch Office
Reply Bookmark "bug in rule roundup #231" Watch "bug in rule roundup #231" New topic
Author

bug in rule roundup #231

evansac
Greenhorn

Joined: May 25, 2000
Posts: 2

overloaded should be overidden
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 17883

Let's take a look:
Here is the current question:
(#231)TRUE or FALSE: overloaded methods must not throw new checked exceptions not thrown by the original method.

Here is the current Answer:
FALSE This would be true for overriding methods, but overloaded methods are free to throw new checked exceptions.

I think the answer is correct as is. Anybody else wanna chip in on this one?
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Thats right.
In the case of overridden methods, the following rules apply:
** overriding methods that throw exceptions, may throw the same/a subclass or a runtime excption that are thrown by the overridden methods
and for overloaded methods they are:
** overloading methods may throw any exception that are not available in the overloaded method
[This message has been edited by Lionel (edited May 30, 2000).]
evansac
Greenhorn

Joined: May 25, 2000
Posts: 2
The question as worded makes no sense to me:
TRUE or FALSE: overloaded methods must not throw new checked exceptions not thrown by the original method.
The term "original method" has no meaning in the context of
overloaded methods, but it does in the case of an overriden
method.
Are you suggesting that the student is supposed to spot that
the question makes no sense and so answer false?
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 17883

Yup!
The statement is false, is it not?
 
 
subject: bug in rule roundup #231
 
developer file tools