📄 helloimpl.java
字号:
package helloinapplet;import java.rmi.*;import java.rmi.server.*;public class helloImpl extends UnicastRemoteObject implements hello //实现接口函数{ public helloImpl(String name) throws RemoteException //抛出RemoteException异常 { super(); try { Naming.rebind(name, this); //将name参数与此类绑定 } catch (Exception e) { System.out.println("Error: " + e); //捕捉异常情况 } } public String sayHello() //实现远程方法 { return "Hello,world!"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -