+ 1
How to obtain multiple input using Scanner ?
How can I use Scanner two time in my program at different places to obtain two different inputs ? Please show an example if possible .
4 ответов
+ 6
No: code playground will not allow interactive (run time) inputs: it expected ALL the required input at once at start (each one separated by new line, but in only once input)
+ 3
Scanner sc=new Scanner(System.in);
String name=sc.nextLine();
int n=sc.nextInt();
+ 3
you need to pass all input one by one in separate line
0
Does code play ask for two separate inputs ?
@Sami Khan (Мя. Кнап).