📄 myclient.java
字号:
package com.test;
import java.rmi.*;
import java.util.*;
public class MyClient
{
public static void main(String args[]) throws RemoteException
{
new MyClient(args[0]);
}
public MyClient(String host)
{
try
{
RmtServer server = (RmtServer)Naming.lookup("rmi://"+host+"/MyServer");
System.out.println("the next will call remote method");
System.out.println(server.getDate());
System.out.println(server.task(new MyCalculation(2,3)));
}
catch(java.io.IOException e)
{
e.printStackTrace();
}
catch(NotBoundException e1)
{
e1.printStackTrace();
}
}
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -