# Problem with My Leap Year Calculation

• February 7th, 2012, 08:35 AM
LittleGirl
Problem with My Leap Year Calculation
Hello guys ,,, how r u?
Guys i need a quick help with my leap year calculation...

what i did is this :

Code :

```public static boolean isLeapYear(int year) {     if ((year % 4 == 0) && (year % 100 !== 0) && (year % 400 == 0))   { return true; }   else if { return false; }```

it gives me an error and says:

missing return statement & illegal start of expression

:-L

HELP !
• February 7th, 2012, 09:43 AM
lorider93p
Re: Problem with My Leap Year Calculation
Code java:

```public static boolean isLeapYear(int year) {   boolean leap = false;   if ((year % 4 == 0) && (year % 100 !== 0) && (year % 400 == 0)) { leap = true; }   return leap; }```

try that. it should work but i am not possitive as i do not have access to a computer with a jdk. If it does not work i shall try it at 12 ish and repost with a working code.
• February 7th, 2012, 09:47 AM
LittleGirl
Re: Problem with My Leap Year Calculation
Didn't work
the same
illegal start of expression & it is giving me errors
• February 7th, 2012, 09:56 AM
lorider93p
Re: Problem with My Leap Year Calculation
Code java:

``` public static boolean isLeapYear(int year) {   boolean leap = false;   if ((year % 4 == 0) && (year % 100 != 0) && (year % 400 == 0)) { leap = true; }   return leap; }```

The symbol == means equal to and != means not equal to and the code you had written had !== meaning not equal to equal. (doesnt make much sence in english either. )
• February 7th, 2012, 09:57 AM
lorider93p
Re: Problem with My Leap Year Calculation
you could keep your original code also it would work as long as you fix the !== to !=