Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementing an Interface and throws clause

 
Morgan Roth
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1056
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can throw fewer exceptions. You can't throw more, because then you'd be violating the interface contract.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic