Thread: Printf in java

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    Printf in java


    Hi,
    import com.braju.format.*;
    String s ="the value of %d \tis %d\n";
    Parameters p=new Parameters();
    Format.printf(s,p.add(5).add(6));

    output:
    the value of 5 \tis 6\n

    but when i give as,

    Format.printf("the value of %d \tis %d\n",p.add(5).add(6));

    output:
    the value of 5 is 6

    I want to know the reason why the first one is not printing the literals.
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,699
    Rep Power
    347
    Can you post code that will compile, execute and show the problem?

IMN logo majestic logo threadwatch logo seochat tools logo