Java interface throws an exception but interface implementation does not throw an exception?

A general rule of implementing and extending is you can make your new class or interface “less restrictive” but not “more restrictive”. If you think of the requirement to handle an exception as a restriction, an implementation that doesn’t declare the exception is less restrictive. Anybody who codes to the interface will not have trouble with your class.

— Stan James


As part of the discussion at http://www.coderanch.com/t/399874/java/java/Methods-throwing-Exception-Interface

Leave a Comment

tech