aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Java RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Java RMI" Watch "Java RMI" New topic
Author

Java RMI

ritesh thakur
Greenhorn

Joined: Jul 08, 2013
Posts: 13

below is a code to implement a simple program of addition using RMI. When i implement the interface HELLOINTERFACE.java in HELLO.java, why do i have to make a constructor hello in hello.java ?



Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41853
    
  63
Since we're talking about a no-argument constructor, normally the default constructor would suffice. But since the no-argument constructor of the class you're extending (UnicastRemoteObject) throws RemoteException, so must the one in this class - and the default constructor doesn't do that.


Ping & DNS - my free Android networking tools app
ritesh thakur
Greenhorn

Joined: Jul 08, 2013
Posts: 13

so, because the class I am extending is throwing and exception, I have to declare a constructor ?
Regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41853
    
  63
In this case, yes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java RMI