• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compiler do not complain in the interface-implementating class

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic