java nextline clear buffer code example
Example: java clear bufffer to take next string inpuit
if(!input.hasNext() || !input.hasNextInt()) {
input.next();
continue;
}
int cmd = input.next();
if(!input.hasNext() || !input.hasNextInt()) {
input.next();
continue;
}
int cmd = input.next();