Earlier in my code I call the method
public static boolean divides(int num, int denom)
{
if (num%denom==0)
return true;
else return false;
}
Later I am calling the method
public static boolean isLeapYear(int year)
I want to call divides in isLeapYear. Do I have to define divides all over again? Right now I have
public static boolean isLeapYear(int year)
{
public static boolean divides(int num, int denom)
{
if (divides.class == true && (year%400 ==0) || ((year%4==0)
&& (year%100 !=0)));
return true;
else return false;
}
}
And I get the error that divides is already defined, but when I don't put the whole public static etc. statement in there it wonders what divides is.
I'm also getting a host of other errors (such as it not being able to find year's type after I nest divides), but that's not the main one.