📄 testserver.java
字号:
package dfbz.rmi;
import javax.naming.InitialContext;
public class TestServer {
public static void main(String[] args) throws Exception {
//test1();
test2();
}
public static void test1() throws Exception{
HelloWorld h = new HelloWorld();
InitialContext initCntx = new InitialContext();
initCntx.rebind("helloworld", h);
System.out.println("HelloWorld has already bulid");
}
public static void test2() throws Exception{
StudentService s = new StudentService();
InitialContext ictx = new InitialContext();
ictx.rebind("stu",s);
System.out.println("服务器端对象已经创建");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -