Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1.  
  2. import java.net.MalformedURLException;
  3. import java.rmi.Naming;
  4. import java.rmi.NotBoundException;
  5. import java.rmi.RemoteException;
  6.  
  7. /**
  8.  * Klient, toto budeme u zkousky vytvaret.
  9.  */
  10. public class Client {
  11.  
  12.     private static final int SIZE = 10;
  13.  
  14.     public static void main(String[] args) throws NotBoundException, MalformedURLException, RemoteException {
  15.         Reverter reverter = (Reverter) Naming.lookup("rmi://localhost:12345/Reverter");
  16.         Object[] obj = new Object[SIZE];
  17.  
  18.         for (int i = 0; i < SIZE; i++) {
  19.             obj[i] = (i + 1) + ".hodnota";
  20.         }
  21.  
  22.         obj = reverter.revert(obj);
  23.  
  24.         for (Object o : obj) {
  25.             System.out.println(o);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement