Find maximum number in array - Java Quiz Question


Write a program to find the maximum number in array.

Input (Integer Array) Output (Integer)
{2, 3, 4, 7, 6, 1} 7
{3, 9, 1, 5, 16, 10} 16
{195, 31876, 123, 20000, 15122, 789} 31876
{36187, 31876, 38761, 37861, 37618, 38671} 38761



class MaximumNumberInArray
{
    public static void main(String s[])
    {
        int[] input = {2, 3, 8, 5, 4};
        int maximum = getMaximumNumberInArray(input);
        System.out.println("Maximum Number is " + maximum);

    }


    public static int getMaximumNumberInArray(int[] array)
    {
        int result = 0;
        return result;
    }

}