This method finds the maximum element in an integer array using the Stream API.
Code Example:
public static int findMaxElement(int[] arr) { return Arrays.stream(arr).max().getAsInt(); }
Input:
12, 19, 20, 88, 00, 9
Output:
88