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.


//from  ww  w  . j  a  v a 2s.c o  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.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable