Here you can find the source of max(final int... array)
Parameter | Description |
---|---|
array | a parameter |
public static int max(final int... array)
//package com.java2s; //License from project: Open Source License public class Main { /**/*w ww. j a v a 2 s. c om*/ * Find maximum out of Integer array * * @param array * @return {@link int} */ public static int max(final int... array) { if (array == null) { return 0; } int max = array[0]; for (int i = 0; i < array.length; i++) { if (array[i] > max) { max = array[i]; } } return max; } }