Java Number Max Value max(int x, int y)

Here you can find the source of max(int x, int y)

Description

Get maximum of two given values

License

Open Source License

Parameter

Parameter Description
x Value 1
y value 2

Return

Max of the two values

Declaration

public static int max(int x, int y) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from w w  w .  j  a va2s . co  m*/
     * Get maximum of two given values
     * 
     * @param x Value 1
     * @param y value 2
     * @return Max of the two values
     */
    public static int max(int x, int y) {
        return (x > y) ? x : y;
    }

    /**
     * Get maximum of two given values
     * 
     * @param x Value 1
     * @param y value 2
     * @return Max of the two values
     */
    public static double max(double x, double y) {
        return (x > y) ? x : y;
    }
}

Related

  1. max(int i, int j)
  2. max(int i, int j)
  3. max(int i, int j, int k)
  4. max(int idx, int orderFrom, int orderTo)
  5. max(int x, int x2, int x3)
  6. max(Integer a, Integer b)
  7. max(Integer i1, Integer i2)
  8. max(Iterable nums)
  9. max(long a, long b)