Sunday, February 22, 2009

array length example source code



//array length example source code

package arrays;

public class ArrayLength {


public static void main(String[] args) {
int [] a=new int[6];
System.out.println(a.length); // 6
int [][] b=new int [3][4];
System.out.println(b.length); // 3
System.out.println(b[0].length); // 4

}

}



0 comments:

Post a Comment