This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Have the determination of mirror which never fails to reflect in spite of being broken into pieces.<br /> <br />Kiss the hands you cannot bite.<br /> <br />An Optimist is one who starts taking a bath when he accidentally falls into the water.
Ulf Dittmer is correct; the printf method of whatever System.out is (I think it's a PrintStream, but you would have to check the API) was introduced in J5. The format method was introduced at the same time; both of them do something very similar, but you will have to check the API to be sure.
Both of them actually call the Formatter class (as far as I can remember).
As for precision of a double: as long as you stay within a range from Double.MAX_VALUE and Double.MIN_NORMAL_VALUE (at least I think that's what it is called) the precision is fixed at 53 bits, which is equivalent to 53*log10(2) decimal digits which is 15.954589770191003346328161420398 approximately. Well, nearly 16. So whatever you write in a double, you get it accurate to nearly 16 digits; 223.3331 is less than 16 digits, and 15.954589770191003346328161420398 is more than 16 digits, so the last part of this number will disappear into cyber-limbo. The precision of what you store and the precision of what you display can be differentprints: