0

Could someone help me with my test script?

Im fairly new to scripting, and wanted to practice what ive learned, but for some reason, i just cant get this script to run properly, could someone help or point out some silly mistake i mightve made import java.util.scanner; public class test2 { public static void main(String args[]){ system.out.println("Enter your age: "); Scanner sc=new scanner(system.in); int age=sc.nextint(); if(age<=16){ system.out.println("No");} else { system.out.println("yes"); } } }

14th Jul 2019, 4:33 PM
ZaynXT
ZaynXT - avatar
3 odpowiedzi
+ 2
Java is case sensetive. system starts with an appercase letter ("System"), nextint has also uppercase letters ("nextInt"); and scanner also starts with an uppercase letter ("Scanner")
14th Jul 2019, 4:48 PM
Airree
Airree - avatar
+ 2
Yes, that was literally the issue. Here's a tip: look at the error messages. They can tell your problems immediately.
14th Jul 2019, 4:50 PM
Airree
Airree - avatar
0
was that literally the issue? Thank you so much.
14th Jul 2019, 4:49 PM
ZaynXT
ZaynXT - avatar