title: Java, getting an ArrayList index by object
body: <p>so I have hit a little problem in my code I have: </p>
  
  <pre><code>synchronized(clients)
              clients.remove(this);
  }
  </code></pre>
  
  <p>for when a client disconnects, but now I need to be able to send the name of that client to all the other clients, and to do this I essentialy need to do something like</p>
  
  <pre><code>synchronized(clients)
              broadcast("Remove:"+clients.get(this).name);
              clients.remove(this);
  }
  </code></pre>
  
  <p>but obviously I can't get an index with the "this", so how do I go about getting the right clients name? Thanks!</p>