Check out example codes for "java max". It will help you in understanding the concepts better.

Code Example 1

public class Test { 

   public static void main(String args[]) {
      System.out.println(Math.max(12.123, 12.456));      
      System.out.println(Math.max(23.12, 23.0));  
   }
}

Learn ReactJs, React Native from akashmittal.com