第6章 Java C/S结构编程 197
实例67 实现C/S多线程 198
实例68 客户端程序 200
实例69 服务器端程序 201
实例70 C/S结构
源代码在线查看: rmiproblemsetimpl.java
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
public class RMIProblemSetImpl
extends java.rmi.server.UnicastRemoteObject
implements RMIProblemSet {
protected double value;
protected double solution;
public RMIProblemSetImpl() throws RemoteException {
value = 0.0;
solution = 0.0;
}
public double getValue() throws RemoteException {
return value;
}
public double getSolution() throws RemoteException {
return solution;
}
public void setValue(double v) throws RemoteException {
value = v;
}
public void setSolution(double s) throws RemoteException {
solution = s;
}
}