OK so here is my arraylist.
private List<ClientThread> clients = new ArrayList<ClientThread>();
and here is what i am trying to do. I am trying to remove the last known item from the arraylist i posted above... doing this:
} catch(SocketException re) {
String hey = clients.get(clients.size());
ClientThread.remove(hey);
System.out.println(hey + " has logged out.");
System.out.println("CONNECTED PLAYERS: " + clients.size());
}
but I am getting this error:
C:\wamp\www\mystikrpg\Server.java:147: incompatible types
found : Server.ClientThread
required: java.lang.String
String hey = clients.get(clients.size());
^
C:\wamp\www\mystikrpg\Server.java:148: cannot find symbol
symbol : method remove(java.lang.String)
location: class Server.ClientThread
ClientThread.remove(hey);
^
2 errors
what am I doing wrong? it's suppose to remove the last known item from arraylist.