Java Data Type Tutorial - Java StrictMath.max(float a, float b)








Syntax

StrictMath.max(float a, float b) has the following syntax.

public static float max(float a, float b)

Example

In the following code shows how to use StrictMath.max(float a, float b) method.

/* ww  w.ja v a2s.  co m*/
public class Main {

  public static void main(String[] args) {
  
    float f1 = 60 , f2 = 40, f3 = -5;
     
    System.out.println(StrictMath.max(f1, f2));
     
    System.out.println(StrictMath.max(f1, f3));    
  }
}

The code above generates the following result.