ChoiceFormat nextDouble(double) method in Java with Examples
The nextDouble(double) method of java.text.ChoiceFormat class is used to get the double value just greater than the specified double value.
public static final double nextDouble(double d)
Parameter: This method accepts double value d as a parameter for which the next double value is returned.
Return Value: This method returns an double value just greater than the passed double value.
Below are the examples to illustrate the nextDouble() method:
Next greater double value than 22: 22.000000000000004
Next greater double value than 1.23: 1.2300000000000002 Next greater double value than 10.0: 10.000000000000002 Next greater double value than -12.0: -11.999999999999998 Next greater double value than 1.2000000476837158: 1.200000047683716 Next greater double value than 50.0: 50.00000000000001
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.