Java Array Max Value maxPositive(int[] array)

Here you can find the source of maxPositive(int[] array)

Description

max Positive

License

Open Source License

Declaration

public static int maxPositive(int[] array) 

Method Source Code

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

public class Main {
    public static int maxPositive(int[] array) {
        int res = 0;
        if (max(array) > 0)
            res = max(array);//ww w  .  j  a v a  2 s  .c  om
        return res;
    }

    public static int max(int[] array) {
        int res = array[0];
        for (int i : array) {
            if (i > res)
                res = i;
        }
        return res;
    }
}

Related

  1. maxNum(Number iArr[])
  2. maxOfSortedValues(double[] sortedValues)
  3. maxOverArraySubset(double[] array, Iterable subset)
  4. maxpool(float[] curr, float[] probs)
  5. maxPosition(float[] v)
  6. maxPrim(final int... numbers)
  7. maxRepeating(int[] input, int k)
  8. maxRow(Object[]... arr)
  9. maxRowLen(Object[]... arr)