+ 4

Java scanner input help

im progressing through learning java and you cant learn real world experience without experimenting but i cant seem to work out where this code is going wrong https://code.sololearn.com/cCFolm34Xr7a/?ref=app

29th Jan 2018, 11:02 AM
MaxBanter
MaxBanter - avatar
9 ответов
+ 12
@Swan use like this int age = sc.nextInt(); I is in upper case in nextInt();
29th Jan 2018, 11:12 AM
GAWEN STEASY
GAWEN STEASY - avatar
+ 18
int age = new Scanner(System.in).nextInt(); //for reducing 1 line ☺👍
29th Jan 2018, 11:17 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
In line 5 you've to replace sc.Nextint() with sc.nextInt(). Java is casesensitive.
29th Jan 2018, 11:07 AM
Jente
+ 3
i still get cannot find symbol indicating to the fullstop
29th Jan 2018, 11:10 AM
MaxBanter
MaxBanter - avatar
+ 2
thankyou it was a combination of both incorrect upper/lower case
29th Jan 2018, 11:14 AM
MaxBanter
MaxBanter - avatar
+ 2
sorry ive been updating and saving the code with each suggestion should i comment in the original lines so it helps other people with the same issue i had
29th Jan 2018, 11:20 AM
MaxBanter
MaxBanter - avatar
+ 1
what do you mean with fullstop?
29th Jan 2018, 11:11 AM
Jente
+ 1
yes :) , It would help others who are learning to understand it.
29th Jan 2018, 11:21 AM
Alex Snyder
Alex Snyder - avatar
0
It seems ok to me :)
29th Jan 2018, 11:19 AM
Alex Snyder
Alex Snyder - avatar