Here you can find the source of max(double... elems)
static double max(double... elems)
//package com.java2s; //License from project: Open Source License public class Main { static double max(double... elems) { if (elems.length == 0) return 0; double best = elems[0]; for (double t : elems) { if (t > best) { best = t;/*from www. ja v a 2 s . c o m*/ } } return best; } static int max(int... elems) { if (elems.length == 0) return 0; int best = elems[0]; for (int t : elems) { if (t > best) { best = t; } } return best; } }