+ 1
Why doesn't my code work?
3 ответов
+ 6
Scanner sc = new Scanner(System.in);
int thot = sc.nextInt();
Make the above change and you are good to go. Also your first and last conditions are same so change it.
+ 5
It's because you are trying to compare an integer to a Scanner object. You can fix it easily:
int thot_age = thot.nextInt();
and use that variable for comparison.
Also, you might want to check your conditions, because there are things
+ 3
Thx, it works now. I am new to java, just trying to have fun with learning.