user
Write a Java program which finds the maximum number from a given array

assistant
public class MaxNumber {
    public static int findMax(int[] arr) {
        int max = Integer.MIN_VALUE;
        for (int i=0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        return max;
    }

    public static void main(String[] args) {
        int[] numbers = {2, 3, 1, 5, 9};
        int max = findMax(numbers);
        System.out.println("The maximum number is: " + max);
    }
}