To write a number of type double or float, we can directly use the print or println methods:
Example: The following code fragment
prints on the screendouble d = 98d; System.out.println("d = " + d); float x = 0.0032f; System.out.println("x = " + x);
d = 9.8E1 x = 3.2E-3