min(a,b) and max(a,b) equivalent in Java?
Math.min()
? (Comes in several overloads for different types.)
have a look at the javadoc of Math
you can use it like :
import static java.lang.Math.*;
public static void main(String[] args) {
System.out.println(min(1, 0));
}
See the class java.lang.Math
functions of min
and max
for various types.