We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Here we used printf to repeat the values of 0 and space.
'-%15s' means that the length of string will be 15 and spaces will be repeatedly printed on right side of string.
And '%03d' means length of string will be 3 and '0' will be repeatedly printed on left side of string.
Java Output Formatting
You are viewing a single comment's thread. Return to all comments →
Here we used printf to repeat the values of 0 and space. '-%15s' means that the length of string will be 15 and spaces will be repeatedly printed on right side of string. And '%03d' means length of string will be 3 and '0' will be repeatedly printed on left side of string.