Java Utililty Methods Array Max Value

List of utility methods to do Array Max Value

Description

The list of methods to do Array Max Value are organized into topic(s).

Method

doublemax(final double[] nums)
Returns the largest value stored in the array.
return nums[indexOfMax(nums)];
intmax(final double[] tab)
max
int index = 0;
double max = tab[index];
for (int i = 0; i < tab.length; i++) {
    index = tab[i] > max ? i : index;
return index;
doublemax(final double[] target)
Returns the maximum of target.
return max(target, 0, target.length);
doublemax(final double[] values)
max
int maxid = argMax(values);
return values[maxid];
doublemax(final double[] vec)
Computes the maximum of the elements of a vector.
assert vec != null;
double max = vec[0];
for (double i : vec) {
    if (i > max) {
        max = i;
return max;
...
voidmax(final float[] a, final float[] b)
Writes max(a,b) into a
for (int i = 0; i < a.length; ++i)
    if (b[i] > a[i])
        a[i] = b[i];
intmax(final int... array)
Find maximum out of Integer 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;
intmax(final int... integers)
Returns maximum of the specified integer numbers.
int max = integers[0];
for (int i = 1; i < integers.length; i++) {
    max = Math.max(max, integers[i]);
return max;
intmax(final int... numbers)
max
if (numbers.length == 0) {
    throw new IllegalArgumentException("at least one parameter is required");
int max = numbers[0];
for (int i = 1; i < numbers.length; i++) {
    int number = numbers[i];
    if (number > max) {
        max = number;
...
intmax(final int... values)
max
int retVal = values[0];
for (int i = values.length; i-- != 1;) {
    retVal = values[i] > retVal ? values[i] : retVal;
return retVal;