I'm new with java.. following the book "teach yourself java in 21 days"
I tried to print
System.out.format("%,d%n", total[0]);
And it printed 5a000a000 instead of 5,000,000
Why??
I'm new with java.. following the book "teach yourself java in 21 days"
I tried to print
System.out.format("%,d%n", total[0]);
And it printed 5a000a000 instead of 5,000,000
Why??
The statement is correct and when I ran it on my machine I got the correct result.Quote:
Originally Posted by javeriaz
What OS are you running this on?
What are you using to compile?
I would recommend you place: System.out.println(total[0]); on the line right before the format just to make sure the value in total[0] is what you expect.
All times are GMT -7. The time now is 03:55 AM. |