二维数组

package myPro1;

public class T4 {
	public static void main(String[] args) {
		int[][] arr = { { 1, 2, 3 }, { 2, 34, 44, 33, 44, 3 }, { 1, 2, 3, 4 } };
		
		//arr.length
		for (int i = 0; i < arr.length; i++) {
			
			//arr[i].length
			for (int j = 0; j < arr[i].length; j++) {
				System.out.print(arr[i][j] + " ");
			}
			System.out.println();
		}
	}
}

猜你喜欢

转载自8850702.iteye.com/blog/2275039