Here you can find the source of max(final int a, final int b)
Parameter | Description |
---|---|
a | First value. |
b | Second value. |
public static int max(final int a, final int b)
//package com.java2s; /**/*w w w . j ava 2 s. com*/ * Static helper class to centralize various useful methods * that do not fit in any other util. * Copyright (c) 2015 Vinland Solutions * Creative Commons Attribution-NonCommercial <http://creativecommons.org/licenses/by-nc/3.0/deed.en_US> * @author JayJeckel <http://minecraft.jeckelland.site88.net/> */ public class Main { /** * Return the greater of the two values. * @param a First value. * @param b Second value. * @return Larger value. */ public static short max(final short a, final short b) { return (a >= b ? a : b); } /** * Return the greater of the two values. * @param a First value. * @param b Second value. * @return Larger value. */ public static int max(final int a, final int b) { return (a >= b ? a : b); } /** * Return the greater of the two values. * @param a First value. * @param b Second value. * @return Larger value. */ public static long max(final long a, final long b) { return (a >= b ? a : b); } /** * Return the greater of the two values. * @param a First value. * @param b Second value. * @return Larger value. */ public static float max(final float a, final float b) { return (a >= b ? a : b); } /** * Return the greater of the two values. * @param a First value. * @param b Second value. * @return Larger value. */ public static double max(final double a, final double b) { return (a >= b ? a : b); } }