public class TestArray{
public static void main(String[] arg){
int[][] J={{1,2,3} ,{4,5,6} ,{7,8,9} };
System.out.println("J.length="+J.length);
System.out.println("J[1].length="+J[1].length);
System.out.println("J[2].length="+J[2].length);
J[1]=new int[1];
J[2]=new int[2];
System.out.println("J.length="+J.length);
System.out.println("J[1].length="+J[1].length);
System.out.println("J[2].length="+J[2].length);
}
}
沒有留言:
張貼留言