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.
Java Output Formatting
Java Output Formatting
Sort by
recency
|
1463 Discussions
|
Please Login in order to post a comment
This is a great exercise for learning how to control output formatting in Java. cbtfturbo 247
System.out.printf("%-15s%03d\n", s1, x); Prints a left-aligned string in 15 spaces and a 3-digit integer padded with zeros, followed by a newline.
Java is such a powerful and versatile language — great for everything from building Android apps to large-scale enterprise systems. cricbet99