public class trigon2{
public static void main(String[] args){
int[][] triarray=new int[10][];
for(int i=0;i<triarray.length;i++){
triarray[i]=new int[++i];
}
int k=0;
for(int i=0;i<triarray.length;i++){
for(int j=0;j<triarray[i].length;j++){
j=0;
triarray[i][j]=++k;
System.out.println(triarray[i][j]);
}
}
}
}
//运行后,抛出异常:
//Exception in thread "main" java.lang.NullPointerException
// at trigon2.main(trigon2.java:9)
posted on 2007-02-24 22:34
JIM.WU 阅读(448)
评论(5) 编辑 收藏