Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

bug in rule roundup #231

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

overloaded should be overidden
 
Trailboss
Posts: 23192
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23192
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup!
The statement is false, is it not?
 
"To do good, you actually have to do something." -- Yvon Chouinard
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic