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

📄 helloimpl.java

📁 有关于rmi和 rmi-iiop远程服务器调用的几个实例 包括Fibonacci和用户输入的四则运算等等
💻 JAVA
字号:
import java.rmi.RemoteException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.UnicastRemoteObject;

//Service Class
public class helloImpl extends UnicastRemoteObject implements hello {
 	public helloImpl() throws RemoteException {
		// TODO Auto-generated constructor stub
	}

	public helloImpl(int arg0) throws RemoteException {
		super(arg0);
		// TODO Auto-generated constructor stub
	}

	public helloImpl(int arg0, RMIClientSocketFactory arg1,
			RMIServerSocketFactory arg2) throws RemoteException {
		super(arg0, arg1, arg2);
		// TODO Auto-generated constructor stub
	}
	public String hello()
	{   
          int i;
          int a[] = new int[10];
	  a[0]=a[1]=1;
	  String sum = "";
	  for(i=0;i<8;i++)
		  a[i+2] = a[i] + a[i+1];
         
	  sum = Integer.toString(a[i+1]);
		//System.out.println("Fibonacci数列的第十项为:"+sum);
		
		return sum;
	}

}

⌨️ 快捷键说明

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