Write a Java program to find the length of the longest increasing subarray in an array.

Sure, here’s a Java program to find the length of the longest increasing subarray in an array:

public class LongestIncreasingSubarray {
    public static void main(String[] args) {
        int[] array = {1, 2, 3, 2, 3, 4, 5, 6, 7};
        int length = findLongestIncreasingSubarrayLength(array);
        System.out.println("Length of longest increasing subarray: " + length);
    }

    public static int findLongestIncreasingSubarrayLength(int[] array) {
        int maxLength = 1;
        int currentLength = 1;
        for (int i = 1; i < array.length; i++) {
            if (array[i] > array[i - 1]) {
                currentLength++;
            } else {
                maxLength = Math.max(maxLength, currentLength);
                currentLength = 1;
            }
        }
        return Math.max(maxLength, currentLength);
    }
}

In this program, we have an array `array` and we want to find the length of the longest increasing subarray in it. We call the `findLongestIncreasingSubarrayLength()` method to find the length of the longest increasing subarray.

The `findLongestIncreasingSubarrayLength()` method initializes two variables `maxLength` and `currentLength` to 1. It then loops through each element of the array, comparing it to the previous element to check if it is part of an increasing subarray. If the current element is greater than the previous element, `currentLength` is incremented. If the current element is not greater than the previous element, `currentLength` is reset to 1 and `maxLength` is updated if `currentLength` is greater than `maxLength`.

Finally, the `findLongestIncreasingSubarrayLength()` method returns the maximum of `maxLength` and `currentLength`.

Note that this program assumes that the array is non-empty. If the array may be empty, you should add a check at the beginning of the `findLongestIncreasingSubarrayLength()` method to return 0 if the array is empty.