- gamertag: Hank13
- user homepage:
You're trying to return an integer value, when your function (Or 'method', I think that's what they call them in Java, right?) is expecting you to return a value of true or false (IE, 1 for true, 0 for false).
So, if it is a leap year, you need to return 1. If it's not a leap year, you need to return 0.
It ought to look something like this (But bear with me, I'm used to C++, not Java):
public static boolean isLeap (int year) {
if( year%400==0||(year%4==0&&year%100!=0)) {
return 1;
}
return 0;
}
If the statement inside the if statement is true, the method returns 1, and it is therefore a leap year. If the the statement inside the if statement is false, it'll return 0, and it is therefore not a leap year.