This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Implementing an Interface and throws clause Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Implementing an Interface and throws clause" Watch "Implementing an Interface and throws clause" New topic
Author

Implementing an Interface and throws clause

Morgan Roth
Greenhorn

Joined: Oct 31, 2002
Posts: 17
I know if you override a method of a superclass you can declare few throws in the method signature in the subclass but not more. What is the rule for implementing a method of an interface? Can you specify fewer or more Exception classes in the throws or does it have to match exactly. Thanks
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
You can throw fewer exceptions. You can't throw more, because then you'd be violating the interface contract.


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Implementing an Interface and throws clause
 
Similar Threads
Urgent help needed - What adapters provide ??
Interface question
Interface problems
Additional runtime exceptions in DB interface
multithreading