我的代码有什么问题?'if' 语句似乎不起作用!我运行程序并输入我的姓名和年龄。我输入了一个有资格使用该程序的年龄,但它说我太年轻了。我对此进行了编码,但它不会让我使用它!
import java.util.Scanner;
public class learning {
public static void main(String args[]){
Scanner uI = new Scanner(System.in);
System.out.println("Enter your name: ");
System.out.print(uI.nextLine());
System.out.println(", enter your age: ");
uI.nextInt();
int person = 10;
if (person > 10){
System.out.println("You may use this program!");
}else{
System.out.println("You may not use this program. You are too young!");
}
uI.close();
}
}