Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AlignText {
- public static void main(String[] args) {
- String[] names = {"Motley, Paul", "Ross, Bob", "Duck, Donald", "Mouse, Mickey", "Hello, World"};
- String format = "Name: %15s%n";
- for (int i = 0; i < names.length; i++) {
- System.out.printf(format, names[i]);
- }
- }
- }
Add Comment
Please, Sign In to add comment