Its because even though you have a return in the else block the compiler knows that if the code hits the else if statement with no return in it, the method wont return anything and it will complain...