File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can i modify the interface sun providing

 
woo hwang
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a question about the Interface Sun provided.
When I implements RMI, I reliased that i need to thorw RemoteException for all method in the SUN provide interface.

What i am wondering is that can i change interface??
can i throw more exceptions in the sun provided interface?

Cheers
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The one of the must conditions is the original interface should not be altered. You can extend the interface and throw your own exceptions and rmi exceptions.
 
Justin Rundle
Ranch Hand
Posts: 123
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply... No. I mean if you add custom exceptions then you are now programming to an implementation rather than an interface (if you are confused or unsure or never ehard that OO principle, I can suggest Head First Design Patterns).
[ November 30, 2008: Message edited by: Justin Rundle ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic