fubarable

Untitled

Feb 15th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. public class AlignText {
  2.     public static void main(String[] args) {
  3.         String[] names = {"Motley, Paul", "Ross, Bob", "Duck, Donald", "Mouse, Mickey", "Hello, World"};
  4.        
  5.         String format = "Name: %15s%n";
  6.         for (int i = 0; i < names.length; i++) {
  7.             System.out.printf(format, names[i]);
  8.         }
  9.     }
  10. }
Add Comment
Please, Sign In to add comment