public class LeapYear {
public static void main(String args[]) {
int year =1989; //方法1
if(year%4==0&&year%100!=0)||(year%400==0)
System.out.println(year+"是闰年");
else System.out.println(year+"不是闰年");
}
}
错误提示是Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error on token "||", if expected
at Test/hello.LeapYear.main(LeapYear.java:6)