服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 基础入门 > 查看文档

java核心代码例程之:rmiexampleserver.java


import java.rmi.*;
import java.rmi.server.*;

/**
 * this class is a simple example of a rmi server
 * @author renga
 **/
public class rmiexampleserver extends unicastremoteobject 
implements rmiexample {

/**
 * do nothing constructor
 * @throws remoteexception
 **/
public rmiexampleserver() throws remoteexception {
system.out.println( "rmiexampleserver::cntr" );
}

/**
 * returns "hello world from rmi!"
 * @return a string
 * @throws remoteexception
 **/
public string sayhello() throws remoteexception {
return "hello world from rmi!";
}
}

扫描关注微信公众号