Here you can find the source of maxcount(int[] vals, int max, int maxcount)
private static int maxcount(int[] vals, int max, int maxcount)
//package com.java2s; //License from project: Open Source License public class Main { private static int maxcount(int[] vals, int max, int maxcount) { for (int i = 0; i < vals.length; i++) { int v = vals[i]; if (v > max) { max = v;// w w w. j a va 2s . c om maxcount = 1; } else if (v == max) { maxcount++; } } return maxcount; } }