CS计算机代考程序代写 public class AlertServer {

public class AlertServer {

private AlertListener[] clients;
private int numberOfClients;

public AlertServer(int capacity) {
clients = new AlertListener[capacity];
numberOfClients = 0;
}

public void register(AlertListener client) {
clients[numberOfClients] = client;
numberOfClients++;
}

public void broadcast(String message) {
for (int i=0; i