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

📄 testclient.java

📁 来看一个RMI的示例。原理一定要搞清楚.
💻 JAVA
字号:
package dfbz.rmi;

import javax.naming.InitialContext;

	public class TestClient {
	public static void main(String[] args) throws Exception {
		//test1();
		test2();
	}
	
	public static void test1() throws Exception{
		
		InitialContext initCntx = new InitialContext();
		IHelloWorld hw = (IHelloWorld)initCntx.lookup("helloworld");
		String s = hw.hello("philosophy");
		System.out.println(s);
	}
	
	public static void test2() throws Exception{
		InitialContext ictx = new InitialContext();
		IStudentService istu = (IStudentService)ictx.lookup("stu");
		IStudent is = istu.getStudent();
		is.setName("sophy");
		System.out.println(is.getName());
	}
	
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -