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








Syntax

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

public static int max(int a, int b)

Example

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

/* ww  w  . jav a2  s .c o  m*/
public class Main {

  public static void main(String[] args) {
  
    int i1 = 45 , i2 = 23, i3 = -12;

    System.out.println(StrictMath.max(i1, i2));
        
    System.out.println(StrictMath.max(i1, i3));    
  }
}

The code above generates the following result.