Question: Please use **JAVA** to complete 1-3 Use the following code in problems 1-3: double d = 18.798015436; NumberFormat fmt = NumberFormat.getNumberInstance(); fmt.setMaximumFractionDigits(6); fmt.setVinimumFractionDigits(3); String s
Please use **JAVA** to complete 1-3

Use the following code in problems 1-3: double d = 18.798015436; NumberFormat fmt = NumberFormat.getNumberInstance(); fmt.setMaximumFractionDigits(6); fmt.setVinimumFractionDigits(3); String s = fmt.format(d); fmt.setMaximumFractionDigits(1); fmt.setMinimumFractionDigits(0); Stringss=fmt.format(d); 1. What is the value of s? 2. What is the value of ss? 3. Using the Formatter class, write code that will store into String bob, the double precision number xv left justified in a field of 12 characters and having 2 decimal places
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
