the operator type is undefined for the args
当我在 java 中使用任何布尔运算符时,我不断收到错误消息。我是否必须导入布尔类或其他东西?
import java.util.Scanner; //imports Scanner class
public class LeapYear {
public static void main (String[] args) {
//create Scanner object
Scanner input = new Scanner(System.in);
//declare variables
int year;
//get input
System.out.println("Enter year: ");
year = input.nextInt();
//create if statement
if ((year/4) && !(year/100)){
System.out.println("Leap Year");
}
else{
System.out.println("Not a Leap Year");
}
}
}