Q:

Java, program to check which int is larger

I'm new in Java and have encountered a coding problem in a program which is ment to return which given integer is larger.
my code (EDIT);
   public class mandag25nov
{
    public static void main(Strings[] args)
    {
        max(a, b);
    }
    public static int max(int a, int b)
    {
        if (a > b)
        {
            return a;
        }
        else
        {
            return b;
        }
    }
}

Any help would be highly appreciated, thank you!

A:

You're putting your method inside the main method, effectively nesting it. This isn't allowed. Place your max method outside of the main method, and remove the static keyword from the class declaration.
public class mandag25nov
{
    public static void main(Strings[] args)
    {
        max(0, 1) //place the desired arguments in here
    }

    public static int max(int a, int b)
    {
        if (a > b)
        {
            return a;
        }
        else
        {
            return b;
        }
    }
}

