package tutorialJava.capitulo4_Arrays;

import java.util.Iterator;

import tutorialJava.Utils;

public class Ej03_EjemploMatrices {

	public static void main(String[] args) {
//		primeraFormaDeclararUnaMatri();
		segundaFormaDeclararUnaMatri();
	}
	
	/**
	 * 
	 */
	public static void primeraFormaDeclararUnaMatri() {
		int m[][] = new int[4][3];
		
		for (int i = 0; i < m.length; i++) {
			for (int j = 0; j < m[i].length; j++) {
				m[i][j] = (int) Math.round(Math.random() * 100);
			}
		}
		
		
		for (int i = 0; i < m.length; i++) {
			for (int j = 0; j < m[i].length; j++) {
				System.out.print(m[i][j] + " ");
			}
			System.out.println();
		}
		
	}
	
	
	/**
	 * 
	 */
	public static void segundaFormaDeclararUnaMatri() {
		int m[][] = new int[][] {{1, 2, 3}, 
								 {4, 5, 6}, 
								 {7, 8, 9}, 
								 {10, 11, 12}};
				
		for (int i = 0; i < m.length; i++) {
			for (int j = 0; j < m[i].length; j++) {
				System.out.print(m[i][j] + " ");
			}
			System.out.println();
		}
		
	}

}






