Java Number Min Value min(T a, T b)

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

Description

Generalized version of Math.min

License

Open Source License

Declaration

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

Method Source Code

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

public class Main {
    /**/*from  w  w w .  j  a  va2 s. c  om*/
     * Generalized version of Math.min
     */
    public static <T extends Comparable<T>> T min(T a, T b) {
        if (a.compareTo(b) <= 0)
            return a;
        return b;
    }
}

Related

  1. min(String a, String b)
  2. min(String a, String b)
  3. min(String in, int len)
  4. min(String name)
  5. min(String s)
  6. min(T a, T b)
  7. min(T c1, T c2)
  8. min(T v1, T v2)
  9. min(T v1, T v2, int nullSupport)