+ 1
PLEASE HELP ME
i created a java code called "PLEASE HELP ME ".it is not working.so please me.comment on it about how to fix it.anything helps https://code.sololearn.com/c5Q2o193CvAf/?ref=app
8 ответов
+ 2
Or in 1 line
int age = new Scanner(System.in).nextInt();
+ 1
You need to convert input to an int and then compare age.
+ 1
How to do that ?
+ 1
Scanner input......
String num = input.next();
int age = Integer.parseInt(num);
... rest of your code....
+ 1
You need to get the input from the scanner into a variable so you can use it.
Try changing the name of the scanner to 'scanner' and creating an integer variable called age. You can get the integer from the scanner using the `scanner.nextInt()` method.
+ 1
Thanks to everyone who helped me
+ 1
Dilip thnks