• 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

Compiler do not complain in the interface-implementating class

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry that I could not find the answer of this question from the reference book and web resources.
I found that compiler do not complain that even if the method in the interface throws a particular exception (e.g. IOException), the interface-implementing class need not throws the same exception in its method. On the other hand, the class method could throws even more exceptions (e.g. IOException, RemoteException) than the interface method specify.
Is the exception clause in the interface method actually ignored in java?
In the view of OO design, is it regarded as bad design to deliberately discard one of the exception specified in interface in the implementing class?
The last question, if the remote client have the same public methods as suncertify.db.Data class but throws more exception(e.g. RemoteException), is that still regarded as "The remote client code that I write provide all the public methods of the suncertify.db.Data class."?
Thx for any of your advice!
Gerry
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic