You seem to have lots of static imports, but are you actually using them?Jeremiah Waters wrote: . . .
Please don't go thinking there is anything important about the main method. It is like the Union Flag at the Grand Prix at Silverstone. The Union Flag isn't really important: the cars are the important part. It is there for starting the application but there is nothing important about the main method. More information here.The following code is in the main of another class (LeapYear.java).
Don't change your code to correct the error messages. Use the error messages to find the error in your code and change the code to correct the errors. A method with a name starting is should usually return a boolean (not a Boolean). So make your method return a boolean, and run your code until you can pass years and get the results true or false. That shouldn't take long. Note what this old style guide says about boolean returns.
[code=java:fistline[8]]public static String isLeapYear( int year )
//The String above was originally Boolean, but I changed it because Boolean caused a whole other sling of errors.[/code]
Program to the design of your application, not to get rid of the compiler errors. You have two options. You can design a class representing a year, in which case it would have a year number as a field and a method to show whether it is a leap year. That is one option. You would not have a method taking a year number to show whether it is a leap year. That means you have to create a standard Java® class and make objects from it.Attempt to fix 1: . . .
Jeremiah Waters wrote:Thank you Dave and Carey! It's working now!
Don't get me started about those stupid light bulbs. |