profile image

L o a d i n g . . .

package practice;

public class MaxArray {

	public static void main(String[] args) {
		int[] array = { 1, 5, 3, 8, 2 };
		int max = -99999;
		for (int index = 0; index < array.length; index++) {
			if (array[index] > max) {
				max = array[index];
			}
		}
		System.out.println(max);
	}
}
복사했습니다!