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 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
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
Questions on the website: 13722362