提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
衣衫的数组的一个例子
public class Main { public static void main(String[] args) { /** 来 自 时 代 J a v a - N o w J a v a . c o m **/ // Create a two-dimensional array of 3 rows int[][] raggedArr = new int[3][]; // Add 2 columns to the first row raggedArr[0] = new int[2]; // Add 1 column to the second row raggedArr[1] = new int[1]; // Add 3 columns to the third row raggedArr[2] = new int[3]; // Assign values to all elements of raggedArr raggedArr[0][0] = 1; raggedArr[0][1] = 2; raggedArr[1][0] = 3; raggedArr[2][0] = 4; raggedArr[2][1] = 5;//NowJava.com 提 供 raggedArr[2][2] = 6; // Print all elements. One row at one line System.out.println(raggedArr[0][0] +