Java Number Max Value max(T a, T b)

Here you can find the source of max(T a, T b)

Description

Generalized version of Math.max

License

Open Source License

Declaration

public static <T extends Comparable<T>> T max(T a, T b) 

Method Source Code

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

public class Main {
    /**/*from   www .  j  ava  2 s  . co m*/
     * Generalized version of Math.max
     */
    public static <T extends Comparable<T>> T max(T a, T b) {
        if (a.compareTo(b) <= 0)
            return b;
        return a;
    }
}

Related

  1. max(String a, String b)
  2. max(String content, int max, String dotDotDot)
  3. max(String left, String right)
  4. max(String name)
  5. max(String s)
  6. max(T a, T b)
  7. max(T c1, T c2)
  8. max(T c1, T c2)
  9. max(T v1, T v2)