Using a for Loop to Print a 3x3 Matrix
public class Main { public static void main(String[] args) { // Outer for-loop statement for (int i = 1; i <= 3; i++) { // Inner for-loop statement for (int j = 1; j <= 3; j++) { System.out.print(i + "" + j); // Prints a tab after each column value System.out.print("\t"); }//www . ja v a 2 s . c o m System.out.println(); // Prints a new line } } }