This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 41180
    
  45
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: 41180
    
  45
In this case, yes.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Java RMI
 
Similar Threads
Problems with Java RMI
RMI Problem : java.lang.ClassCastException
How to read Clients CPU information on Server
RMI in netbeans on windows
exception in client side