Java tutorial
//package com.java2s; public class Main { public static int getMax(int[] arr) { int max = Integer.MIN_VALUE; for (int i = 0; i < arr.length; i++) { if (arr[i] > max) max = arr[i]; } return max; } }