This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Overriding and Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Overriding and Exceptions" Watch "Overriding and Exceptions" New topic
Author

Overriding and Exceptions

Deepali Pate
Ranch Hand

Joined: Mar 20, 2002
Posts: 114
Someone clarify to me if this is right.
Overridden methods cannot add new checked exceptions.
But is it right that when it is overriding a abstract method it can add new checked exceptions.
Jamal Hasanov
Ranch Hand

Joined: Jan 08, 2002
Posts: 411
Hi, Deepali
Abstract method can be implemented, not overridden...
Jamal Hasanov
www.j-think.com
Deepali Pate
Ranch Hand

Joined: Mar 20, 2002
Posts: 114
Well ya thats right thnx for correcting my blunder.
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055

Overridden methods cannot add new checked exceptions.

Yes.

But is it right that when it is overriding a abstract method it can add new checked exceptions.

No. See below:
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Overriding and Exceptions
 
It's not a secret anymore!