Here you can find the source of max(Integer i1, Integer i2)
Parameter | Description |
---|---|
i1 | the first Integer. |
i2 | the second Integer. |
public static Integer max(Integer i1, Integer i2)
//package com.java2s; /*/*from www . j av a 2s . c om*/ * Copyright (c) 2013-2017 QuartzDesk.com. * Licensed under the MIT license (https://opensource.org/licenses/MIT). */ public class Main { /** * Returns the bigger of the two Integers. A null Integer * is treated as smaller then {@link Integer#MIN_VALUE}. * * @param i1 the first Integer. * @param i2 the second Integer. * @return the bigger of the two Integers. */ public static Integer max(Integer i1, Integer i2) { if (i1 != null && i2 != null) return i1 > i2 ? i1 : i2; return i1 == null ? i2 : i1; } /** * Returns the bigger value of the two int arguments. * * @param i1 the first int. * @param i2 the second int. * @return the bigger value of the two int arguments. */ public static int max(int i1, int i2) { return i1 > i2 ? i1 : i2; } }