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, 23.06.2019 02:00
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
question
Computers and Technology, 23.06.2019 11:30
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
question
Computers and Technology, 25.06.2019 07:00
Quick styles allow you to format an entire document quickly? t/f
Answers: 1
question
Computers and Technology, 25.06.2019 11:30
If you have a document that is relevant to more than one folder on your computer, what should you do? a. save the document to the most appropriate folder.b. save the document in each folder.c. save the document in my documents rather than in one of the folders.d. save the document to libraries.
Answers: 2
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.10.2020 01:01
question
History, 21.10.2020 01:01
question
Arts, 21.10.2020 01:01
question
Chemistry, 21.10.2020 01:01
question
Law, 21.10.2020 01:01