Here you can find the source of max(Long john, Long... jane)
Parameter | Description |
---|---|
john | a parameter |
public static long max(Long john, Long... jane)
//package com.java2s; //License from project: Apache License public class Main { /**/*ww w. j av a 2 s .c o m*/ * Replaces null with 0l * * @param john * @return long */ public static long max(Long john, Long... jane) { if (jane == null) { throw new IllegalArgumentException("jane == null"); } long jill = checkNull(john); for (Long jack : jane) { jill = Math.max(checkNull(jack), jill); } return jill; } /** * Replaces null with 0l * * @param john * @return long */ public static String checkNull(String bean) { return bean == null ? "" : bean; } /** * Replaces null with 0l * * @param john * @return long */ public static long checkNull(Long john) { return john == null ? 0l : john.longValue(); } }