Hi while using the type double if i give the variable the value say 300.00 when i print this value to the screen i only get 300.0, i want the last 0 to print as well. please can anyone one explain this for me.
300.00 and 300.0 are, of course, the same number, so assigning one or the other to a double makes no difference; it will always print in the default format.
If you want to print a number using a specific format, you can use the System.out.printf() method in JDK 1.5, or the java.text.DecimalFormat class in older versions of Java. The Javadocs for each give usage examples.