public class shouldWakeUp {
public static boolean shouldWakeUp(boolean barking, int hourOfTheDay) {
if (barking) {
if (hourOfTheDay=8 || hourOfTheDay=7 || hourOfTheDay=6 || hourOfTheDay=5 || hourOfTheDay=4 || hourOfTheDay=3 || hourOfTheDay=2 || hourOfTheDay=1 || hourOfTheDay=23 || hourOfTheDay=00) {
return true;
} else {
return false;
}
if (hourOfTheDay < 0 || hourOfTheDay > 23)
return false;
}
}
}
我无法理解错误,它说:。operator || cannot be included in int
不负相思意
ibeautiful
相关分类