Can some one help me with my programming project, it is supposed to loop. If the number is even output comes out even and vise-versa. Can someone please tell me what is wrong with my code.
Errors
"3 errors found:
File: C:\Users\Kaamil\evenodd test.java [line: 1]
Error: The public type NumberEvaluator must be defined in its own file
File: C:\Users\Kaamil\evenodd test.java [line: 3]
Error: Duplicate method evenOdd(int) in type NumberEvaluator
File: C:\Users\Kaamil\evenodd test.java [line: 8]
Error: Duplicate method evenOdd(int) in type NumberEvaluator"
Code.
public class NumberEvaluator
{
public void evenOdd(int num)
{
}
public void evenOdd(int num)
{
if (num % 2 == 0)
{
System.out.println ("even");
}
else
{
{
System.out.println ("odd");
}
}
}
public static void main(String [] args)
{
int number;
NumberEvaluator nE = new NumberEvaluator();
nE.evenOdd(-5);
nE.evenOdd(0);
nE.evenOdd(7);
}
}