Java Output Formatting

  • + 3 comments

    Hello, I looked at that link too, but I didn't understand why I had to code like:

    System.out.printf("%-15s%03d%n", s1, x);

    and I couldn't do

    System.out.printf("%-15s %03d %n", s1, x);

    (with spaces between %-15s and %03d...)