Java Double max() MethodThe max() method of Java Double class returns the double object having greater value amongst two double values. The result returned is same as by invoking Math.max() method. SyntaxParametersHere, a & b are the two operands to be compared Return valueThe max() method returns the greater value amongst a and b. Example 1Output: Enter first number. 67 Enter second number 89.001 Enter third number 89.0011 The Max value is: 89.0011 Example 2Output: Enter total number of elements 5 Enter 5 elements 90.009 98.887 67.8898 7566 77 Maximum value : 7566.0 Example 3Output: Enter number of elements you want. 5 Enter elements 90.009 90.00008 90 89 89.999 Descending order = 90.009,90.00008,90.0,89.999,89.0, Next TopicJava-double-min-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India