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 09:30
What are the steps involved in accepting all the changes in a document? arrange these in order click edit. click accept or reject. click changes. click accept all.
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Atool that matches persoal skills qualities interests and talets to a career is called a
Answers: 1
question
Computers and Technology, 22.06.2019 16:50
Consider a slotted aloha system, where the time slot equals the fixed duration of each packet. assume that there are 4 stations a,b,c,d sharing the medium. (a) stations a,b,c,d receive one packet each from higher layers at times 1.3, 1.5, 2.6,5.7 respectively. show which transmissions take place when, according to the slottedaloha protocol; describe all transmissions until all four packets have been successful.when needed, each station has access to the following sequence of random number, provided by a random number generator and drawn uniformly between 0 and 1: (1) station a draws numbers: 0.31, 0.27, 0.78, 0.9, 0.9, 0.11, 0. (2) station b draws numbers: 0.45, 0.28, 0.11, 0.83, 0.37, 0.22, 0. (3)station c draws numbers: 0.1, 0.2, 0.3, 0.4, 0. (4) station d draws numbers: 0.36, 0.77, 0.9, 0.1, 0.1, 0.1, 0.1, 0. (b) in slotted aloha, a station transmits in each time slot with a given probability. what probabilities would you assign to each of the four stations so as to: (i) maximize the efficiency of the protocol? (ii) maximize fairness among the four stations? (c) will the efficiency increase or decrease if we modify slotted aloha as follows: (i) get rid of slots and allow stations to transmit immediately? (ii) implement carrier sensing? (iii) implement collision detection? (iv) implement collision avoidance?
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
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
Biology, 10.11.2020 01:00
question
English, 10.11.2020 01:00
question
Mathematics, 10.11.2020 01:00
question
Mathematics, 10.11.2020 01:00
question
Business, 10.11.2020 01:00
question
Mathematics, 10.11.2020 01:00
question
Mathematics, 10.11.2020 01:00
Questions on the website: 13722367