I'm looking for a way to use scanner in a while loop, without advancing twice.
String desc = "";
while (!scanner.next().equals("END")) {
desc = desc + scanner.next();
}
As you can see, when scanner.next() is called in the while loop's condition and inside of the while loop itself. I want it to advance the scanner only once. Is there any way to do that?