Gets the higher number - Android java.lang

Android examples for java.lang:Math

Description

Gets the higher number

Demo Code


//package com.java2s;

public class Main {
    /**/*from  www .j  ava 2  s .co m*/
     * Gets the higher number
     * 
     * @param a
     *            float number
     * @param b
     *            float number
     * @return the higher number between a and b
     */
    public static float max(float a, float b) {
        return a > b ? a : b;
    }

    /**
     * Gets the higher number
     * 
     * @param a
     *            int number
     * @param b
     *            int number
     * @return the higher number between a and b
     */
    public static int max(int a, int b) {
        return a > b ? a : b;
    }
}

Related Tutorials