subject

The following program is on Oracle-JAVA website. Explain the program and all the relevant terms in the program. package example. hello; import java. rmi. Remote; import java. rmi. RemoteException; public interface Hello extends Remote { String sayHello() throws RemoteException; } package example. hello; import java. rmi. registry. Registry; import java. rmi. registry. LocateRegistry; import java. rmi. RemoteException; import java. rmi. server. UnicastRemoteObject; public class Server implements Hello { public Server() {} public String sayHello() { return "Hello, world!"; } public static void main(String args[]) { try { Server obj = new Server(); Hello stub = (Hello) UnicastRemoteObject. exportObject(obj, 0); // Bind the remote object's stub in the registry Registry registry = LocateRegistry. getRegistry(); registry. bind("Hello", stub); System. err. println("Server ready"); } catch (Exception e) { System. err. println("Server exception: " + e. toString()); e. printStackTrace(); } } } package example. hello; import java. rmi. registry. LocateRegistry; import java. rmi. registry. Registry; public class Client { private Client() {} public static void main(String[] args) { String host = (args. length < 1) ? null : args[0]; try { Registry registry = LocateRegistry. getRegistry(host); Hello stub = (Hello) registry. lookup("Hello"); String response = stub. sayHello(); System. out. println("response: " + response); } catch (Exception e) { System. err. println("Client exception: " + e. toString()); e. printStackTrace(); } } }​

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
You know the right answer?
The following program is on Oracle-JAVA website. Explain the program and all the relevant terms in t...
Questions
question
Mathematics, 21.03.2020 12:08
question
Mathematics, 21.03.2020 12:08
question
Mathematics, 21.03.2020 12:09
Questions on the website: 13722362