Java Array Max Value max(final int... integers)

Here you can find the source of max(final int... integers)

Description

Returns maximum of the specified integer numbers.

License

Open Source License

Parameter

Parameter Description
integers integer numbers to process

Return

maximum of the specified integer numbers

Declaration

public static int max(final int... integers) 

Method Source Code

//package com.java2s;
/*/*from w  w  w .j  a v  a2s  .  com*/
 * This file is part of WebLookAndFeel library.
 *
 * WebLookAndFeel library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * WebLookAndFeel library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with WebLookAndFeel library.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    /**
     * Returns maximum of the specified integer numbers.
     *
     * @param integers integer numbers to process
     * @return maximum of the specified integer numbers
     */
    public static int max(final int... integers) {
        int max = integers[0];
        for (int i = 1; i < integers.length; i++) {
            max = Math.max(max, integers[i]);
        }
        return max;
    }
}

Related

  1. max(final double[] target)
  2. max(final double[] values)
  3. max(final double[] vec)
  4. max(final float[] a, final float[] b)
  5. max(final int... array)
  6. max(final int... numbers)
  7. max(final int... values)
  8. max(final int[] arr)
  9. max(final int[] result, final int[] vec1, final int[] vec2)