Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. System.setProperty("java.security.policy", "security.policy");
  2.  
  3. System.setSecurityManager(new SecurityManager());
  4.  
  5. try {
  6.  
  7. RMI_ServerInt myRemoteObject;
  8. myRemoteObject = (RMI_ServerInt)Naming.lookup("//192.168.137.1/ABC");
  9.  
  10. System.out.println("Wysłano do servera: ");
  11.  
  12. Scanner sc = new Scanner(System.in);
  13. System.out.print("Wporwadz pierwsza liczbę: ");
  14. int a = sc.nextInt();
  15. System.out.print("Wporwadz drugą liczbę: ");
  16. int b = sc.nextInt();
  17. System.out.print("Wporwadz pierwsza liczbę: ");
  18. String operation = sc.next();
  19.  
  20. int result = myRemoteObject.getResault(a,b,operation);
  21. System.out.println("Otrzymana z serwera odpowiedź: " +result);
  22.  
  23. } catch (Exception e) {
  24.  
  25. e.printStackTrace();
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement