I'm learning Java and was wondering if it's possible to type numbers in the same line without going over the counter?
for (int i = 0; i < 5; i++) {
int a = sc.nextInt();
if (i == 4){
break;
}
}
If I press enter after every number I type in then i can have only 5 numbers and they are in a column, but if I want to type the numbers in a line, then I can have more than 5 numbers. So is there a way to do that, is there anything similar to \a
in C++?