0
Why won’t this work??
Please tell me why this will not work. I am Confused that age Is working but weight and name Isn’t. I am new to java so please don’t judge. https://code.sololearn.com/cmbwbkX26n7k/?ref=app
5 Respostas
+ 3
Your code is correct but will not work on sololearn because it does not support multiple scanner.
Scanner scan = new Scanner(System.in);
int age = scan.nextInt();
int weight = scan.nextInt();
String name = scan.next() or scan.nextLine();
+ 1
ohhh, ok thanks!
+ 1
ok thanks
0
i thought that there was some error that i was just blind to, and in python you can have multiple inputs, you just have to go down the next line when it asks for an input. i thought that it would be the same in java too.
0
You can have multiple inputs but not multiple scanner. Just use one scanner for all inputs (like I did in my last post). Thats all. ;)