Return | Method | Summary |
---|---|---|
static double | max(double a, double b) | Returns the greater of two double values. |
static float | max(float a, float b) | Returns the greater of two float values. |
static int | max(int a, int b) | Returns the greater of two int values. |
static long | max(long a, long b) | Returns the greater of two long values. |
static double | min(double a, double b) | Returns the smaller of two double values. |
static float | min(float a, float b) | Returns the smaller of two float values. |
static int | min(int a, int b) | Returns the smaller of two int values. |
static long | min(long a, long b) | Returns the smaller of two long values. |
public class Main {
public static void main(String[] args) {
System.out.println(Math.max(2,1.2));
System.out.println(Math.min(2,1.2));
}
}
The output:
2.0
1.2
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |