Java Array Max Value max(final int[] values)

Here you can find the source of max(final int[] values)

Description

Finds that maximum of a list of integers.

License

Open Source License

Parameter

Parameter Description
values the list of integer values

Return

the greatest of all integers

Declaration

public static int max(final int[] values) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//  ww  w .  jav  a 2  s .  c o m
     * Finds that maximum of a list of integers.
     * 
     * @param values the list of integer values
     * @return the greatest of all integers
     */
    public static int max(final int[] values) {
        int m = Integer.MIN_VALUE;
        for (int v : values) {
            if (v > m) {
                m = v;
            }
        }
        return m;
    }
}

Related

  1. max(final int... numbers)
  2. max(final int... values)
  3. max(final int[] arr)
  4. max(final int[] result, final int[] vec1, final int[] vec2)
  5. max(final int[] values)
  6. max(final long[] longs)
  7. max(final Number... numbers)
  8. max(final T p_enum1, final T p_enum2, final T[] enumValues)
  9. max(final T... elements)