⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testserver.java

📁 来看一个RMI的示例。原理一定要搞清楚.
💻 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 + -