Hello,
I have an arraylist:
This arraylist has the names of the current users in it I have done tests and they are in by using the built in add(xx); function.public static ArrayList<String> CurrentUsers = new ArrayList<>();
I get input into a server through here:
String Grabber= INPUT.nextLine(); String[] inFeed = Grabber.split(",");
once I have the input into the inFeed array i am trying to do a check:
for(int i = 0; i < GameServer.CurrentUsers.size(); i++) { System.out.println("made it! - " + CurrentUsers.get(i) + "\n"); if(GameServer.CurrentUsers.get(i).equals(inFeed[1])) { //<---- Error here!!!! System.out.println(GameServer.CurrentUsers.get(i) + " " +inFeed[1] + "\n"); GameServer.CurrentUsers.remove(i); } }
at this line:if(GameServer.CurrentUsers.get(i).equals(inFeed[1])) {
I am getting this error:
java.util.NoSuchElementException: No line found
any idea why??
ps: please excuse the excessive amount of system.out.println's as I am using them for error testing..