Up | Previous | Next |
Then the server must implement it:
public interface ServerInterface { public int register(ClientInterface client); }
We might want to synchronize the registration method, but let's do that later.
public class Server implements ServerInterface { public int register(ClientInterface client) { size++; return size; } int size = -1; }
Furthermore, the client interface needs to be provided:
We can run the setup again, now. (If we do it, this would be test no. 2.)
public interface ClientInterface { }
The clients register, get different id numbers and report them.
Up | Previous | Next |