?? client.java
字號:
package org.lnj.rmi.callback;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
public class Client {
public static final int PORT = 8086;
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成方法存根
try {
//LocateRegistry.createRegistry(PORT);
person man = (person)Naming.lookup("//localhost:"+PORT+"/jack");
HardWork hard = new HardWork();
String info = man.sayName(hard);
System.out.println("info="+info);
} catch (MalformedURLException e) {
// TODO 自動生成 catch 塊
e.printStackTrace();
} catch (RemoteException e) {
// TODO 自動生成 catch 塊
e.printStackTrace();
} catch (NotBoundException e) {
// TODO 自動生成 catch 塊
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -