java主程序的结果。为什么一年被忽略?
public class Main
{
public static void main(String[] args)
{
isLeapYear(1600);
}
public static boolean isLeapYear(int year)
{
if (year < 1 || year > 9999) return false;
if (year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
return true;
}
else return false;
}
}
为什么会这样?运行代码时没有显示输出
# 1 楼答案
由于没有显示任何内容,因此不显示任何输出。要显示输出,请尝试以下操作: