public class Main {
public static void main(String[] args){
int[][] ra = new int[3][]; //from 时 代 J a v a 公 众 号 - nowjava.com
ra[0] = new int[2];
ra[1] = new int[1];
ra[2] = new int[3];
// Populate the ragged array using for loops
for(int i = 0; i < ra.length; i++) {
for(int j = 0; j < ra[i].length; j++){
ra[i][j] = i + j;
}
}/*from 时代Java公众号 - nowjava.com*/
// Print the array using for loops
for(int i = 0; i < ra.length; i++) {
for (int j = 0; j < ra[i].length; j++){
System.out.print(ra[i][j] + "\t");
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。