Make your own free website on Tripod.com
 1:public class arraytest
 2:{
 3:  public static void main(String arg[])
 4:  {
 5:          long [][] a1;
 6:          long [] a2[];
 7:          a2 = new long[3][];
 8:          a1=a2;
 9:          //System.out.println(a1[1][0]);  null pointer exception
10:          int i1[][];
11:          int i2[][];
12:          int i3[][]={{1,1},{2,2}};
13:          i1 = new int [][] {{1,1},{2,2}};
14:          //i2 = {{1,1},{2,2}}; incorrect, only when you initialize       
15:          i2 = new int [3][];
16:          System.out.println("i1="+i1+"i2="+i2+"i3="+i3);
17:          //just to do a check doesnt print anything useful
18:  }
19:}