Java Math.min(long a, long b)
Syntax
Math.min(long a, long b) has the following syntax.
public static long min(long a, long b)
Example
In the following code shows how to use Math.min(long a, long b) method.
//from w w w. j a v a2 s .c om
public class Main {
public static void main(String[] args) {
long x = 123456789098877l;
long y = 123456789098771l;
// print the smaller number between x and y
System.out.println("Math.min(" + x + "," + y + ")=" + Math.min(x, y));
}
}
The code above generates the following result.