Here you can find the source of maxPositive(int[] array)
public static int maxPositive(int[] array)
//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; } }