Math.min(long a, long b) has the following syntax.
public static long min(long a, long b)
In the following code shows how to use Math.min(long a, long b) method.
//from w ww .j a v a 2 s .c o m 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.