Java Array Max Value max(byte[] arr)

Here you can find the source of max(byte[] arr)

Description

max

License

Open Source License

Declaration

public static byte max(byte[] arr) 

Method Source Code

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

public class Main {
    public static byte max(byte[] arr) {
        byte maxValue = Byte.MIN_VALUE;
        for (byte value : arr) {
            if (value > maxValue) {
                maxValue = value;/*  w  w w  .ja  va  2s  . co m*/
            }
        }
        return maxValue;
    }

    public static short max(short[] arr) {
        short maxValue = Short.MIN_VALUE;
        for (short value : arr) {
            if (value > maxValue) {
                maxValue = value;
            }
        }
        return maxValue;
    }
}

Related

  1. findMaxIndex(int[] arr)
  2. findMaxOverlap(final int[] overlapRange, final int[] outputRange, final int[] min, final int[] max)
  3. findMaxValue(int[] array)
  4. findMaxValueIndex(double[] d)
  5. max(boolean useInt, int... value)
  6. max(byte[] array)
  7. max(byte[] array)
  8. max(byte[] lArray, byte[] rArray)
  9. max(byte[] values)