Originally posted by: pcnerd37
The compiler error says: LY.java:92: illegal start of expression
public boolean leap(int year)
Here is the module.
verify is defined up at the top of the class.Originally posted by: neegotiator
Originally posted by: pcnerd37
The compiler error says: LY.java:92: illegal start of expression
public boolean leap(int year)
Here is the module.
Need to declare verify boolean before using it in Leap function? Also your return is missing the 'n' at the end
Originally posted by: kamper
Mind telling us what line 92 is?
So it could be the brackets (something is definitely wrong there, and the compiler often reports those errors much further than the original mistake). Could also be that you've missed the n on the end of return.
That is not a module, it's a method.
Originally posted by: neegotiator
is that LY.java in toString() method supposed to be there? what is that?
Originally posted by: kamper
On that note, the entire toString() method is pointless. What's written there is exactly what'll happen if you don't implement the method. The import java.lang.*; is also redundant. I'm surprised the compiler didn't complain about it. Sorry to nitpick 😛
I didn't say the toString() wasn't ok, just that it's pointless. It doesn't matter if it's implemented in the parent or not because java.lang.Object implements it. Come to think of it, Object is the parent anyways 😛Originally posted by: pcnerd37
Originally posted by: kamper
On that note, the entire toString() method is pointless. What's written there is exactly what'll happen if you don't implement the method. The import java.lang.*; is also redundant. I'm surprised the compiler didn't complain about it. Sorry to nitpick 😛
toString() is redefined in the parent class, so i think its ok. the import has been removed. Nitpicking is good, it helps me learn alot and write better code, im greatful for it.