Ask Experts Questions for FREE Help !
Ask
    javeriaz's Avatar
    javeriaz Posts: 1, Reputation: 1
    New Member
     
    #1

    Jun 30, 2008, 04:39 AM
    Formatting error
    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??
    jstrike's Avatar
    jstrike Posts: 418, Reputation: 44
    Full Member
     
    #2

    Jul 7, 2008, 06:55 PM
    Quote Originally Posted by javeriaz
    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.
    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.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Low level formatting error in FORUS audio recorder [ 1 Answers ]

I have a FORUS Digital Audio Recorder FSV-1000. Last 2 years it was good. Some days ago it is giving error "need low level formatting" "too many bad sectors". But while I give the job to do the Forus giving massage "low format 100%. please wait." After waiting several hours it cannot complete the...

My mp3 player giving write protect error while formatting [ 2 Answers ]

Hi Everybody, I am getting write protect error while copying songs to my mp3 player, also getting the same whil formatting the mp3 player. Please help me to make my mp3 player work. Regards, Ajit

Formatting HD [ 7 Answers ]

Hi all, You may think this an odd question but I would be interested in the answer. Does the Hard Drive depreciate the more it is formatted? If so, does anyone have any idea about approximately how may formats are needed before it depreciates beyond use? Thanks in anticipation.

Formatting Xp Pro Help [ 3 Answers ]

HI EVERYONE IAM NEW HERE AND WHAT A BONUS THIS SITE IS SOOOOO MUCH HELP FROM U ALL HERE,OK IAM HAVE BOUGHT A NEW PC A FEW MONTHS AGO AND CAUSE I DOWNLOAD A LOTA FILES/VIDEOS ECT I NEED TO FULLY FORMAT MY PC NOW MY MATE NORMALY COMES AND SORTS IT BUT HES MISSES Won't LET HIM DOWN TO MINE SO IAM...


View more questions Search