I'm trying to .put a pair into a linkedhashmap but when i put 2 or more the size never changes! When i iterate it i get every pair but in random order but the size stays 1. When i hard code the .put (example playerCoords.put(1,"test")) the size changes.
playerCoords = new LinkedHashMap<Integer, String>();
while (message[0] != "234124214") {
message = (String[]) input.readObject();
if (message[0] != null) {
playerCoords.put(Integer.parseInt(message[0]), message[1]);
output.writeObject(playerCoords);
output.flush();
}
}
EDIT: When i open the program 1 client connects to the server and his coords and port get written in the linkedhashmap (ex. 25565,"1 1 2") and then another joins (ex/ 25566, "1 2 1") and when I iterate i get both of these examples but the size still is 1!