title: Fill ArrayList with sockets in constructor?
body: <p>I am currently trying to take an ArrayList and fill it with sockets using .add, when the socket is passed into the constructor. When i run the debug, it looks like there is only ever 1 socket filling the ArrayList, and no more, even though I've opened like 6 client threads.</p>
  
  <p><strong>Server class</strong></p>
  
  <pre><code>public static void main(String[] args) throws IOException
  {
      final int PORT = 8888;
      ServerSocket server = new ServerSocket(PORT);
      System.out.println("Waiting...");
  
      while(true)
      {
          Socket s = server.accept();
          System.out.println("Client connected");
          Service service = new Service(s);
          Thread t = new Thread(service);
          t.start();
      }
  </code></pre>
  
  <p><strong>Service class</strong></p>
  
  <pre><code> public class Service implements Runnable
  {
  private Socket s;
  private Scanner in;
  private PrintWriter out;
  private ArrayList&lt;Socket&gt; sockets = new ArrayList&lt;Socket&gt;();
  
  public Service(Socket aSocket)
  {
      s = aSocket;
      sockets.add(s);
  }
  </code></pre>