1 public class MultiplicationTable { 2 public static void main(String[] args) { 3 System.out.println(" Multiplication Table"); 4 System.out.print(" "); 5 for (int j = 1; j <= 9; j++) 6 System.out.print(" " + j); 7 8 System.out.println(" ----------------------------------------"); 9 10 for (int i = 1; i <= 9; i++) { 11 System.out.print(i + " | "); 12 for (int j = 1; j <=9; j++) { 13 System.out.printf("%4d", i * j); 14 } 15 System.out.println(); 16 } 17 } 18 }