Here you can find the source of max(int... list)
Parameter | Description |
---|---|
list | list of integer |
public static int max(int... list)
//package com.java2s; //License from project: LGPL public class Main { /**/* w ww . j av a 2 s . co m*/ * Retrieves the maximum integer in the list * * @param list * list of integer * @return the maximum integer */ public static int max(int... list) { int max = list[0]; for (int i : list) { if (i > max) { max = i; } } return max; } /** * Retrieves the maximum long integer in the list. * * @param list * list of long integer * @return the maximum long integer */ public static long max(long... list) { long max = list[0]; for (long i : list) { if (i > max) { max = i; } } return max; } /** * Retrieves the maximum double in the list. * * @param list * list of double * @return the maximum double */ public static double max(double... list) { double max = list[0]; for (double i : list) { if (i > max) { max = i; } } return max; } }