Scaneer a = new Scanner (System.in);
int s = anextInt;
String name = a.NextLine;
почему нету инфи про то что после вводы целого числа в буфере будет /n не до конца понял это что но если после 2 строки поставить a.nextLine тогда буфер очистится
Абубакр Махмудов
4 уровень
Класс Scanner
Комментарии (1)
- популярные
- новые
- старые
Для того, чтобы оставить комментарий Вы должны авторизоваться
gothic
2 марта, 12:51
Advances this scanner past the current line and returns the input that was skipped. This method returns the rest of the current line, excluding any line separator at the end. The position is set to the beginning of the next line.
Since this method continues to search through the input looking for a line separator, it may buffer all of the input searching for the line to skip if no line separators are present.
Scanner.nextLine
Scanner.nextInt
Scanner.next
stackoverflow
chatgpt
0