Tried as below
String d=new String(\"12.00\"); Double dble =new Double(d.valueOf(d)); System.out.println(dble);
Output: 12.0
But i
If you want to format output, use PrintStream#format(...):
System.out.format("%.2f%n", dble);
There %.2f - two places after decimal point and %n - newline character.
%.2f
%n
If you don't want to use PrintStream#format(...), use DecimalFormat#format(...).
PrintStream#format(...)