aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes about RemoteException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "about RemoteException" Watch "about RemoteException" New topic
Author

about RemoteException

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi all,
I am working in RMI.
In my server interface i have to throws RemoteException
and my server class i need to throws DatabaseException
so i got error message : overridden method doese not throw DatabaseException
I'm wondering should i add DatabaseException into server interface

Thanks,
lili
Andrea Gazzarini
Ranch Hand

Joined: Sep 09, 2002
Posts: 125
Hi lili,
Overridden methods can't throws a wider spectrum of exception than overriding methods, so if you have a superclass (or interface) with a method (for example)
void a() throws RemoteException;
you can't make a subclass with the signature above:
void a() throws RemoteException,DatabaseException;
if the situation look like this, you must include DatabaseException inton the signature of the superclass (interface)method
Hope it helps.


Regards,<br />Andrea<br /> <br /><a href="http://www.linkedin.com/in/andreagazzarini" target="_blank" rel="nofollow">Andrea Gazzarini</a><br />Skype ID : gazzax72<br />Google Talk ID : a.gazzarini@gmail.com<br /><a href="http://www.andreagazzarini.blogspot.com" target="_blank" rel="nofollow">My Blog</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about RemoteException