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.
According to my understanding the output should be |12.3450| but after running the code i get |12.345000| .Please explain why is this so??
Also in the second statement how is false related to %b.when should i get true and when should i get false as the output.Please explain with example?
For float number, If the precision is not specified then the default value is 6. so the output is |12.345000|.
If the precision is specified, that is used. As your 2nd case, precision is 2. so output is 7.00ggfalse. false is printed as you pass false as argument. if you pass true, true will be printed.