JAVA请大神帮我看看我这代码哪里错?

2025-05-16 19:11:58
推荐回答(1个)
回答1:

这里有问题
if (month != 2) {
return DAYS[month];
}
你这里不应该是month != 2,因为数组序列是从零开始的当month == 2你return DAYS[2];

其实是三月的天数