6.4.4 The Members of an Array Type

The members of an array type (§10.7) are all of the following:

The example:


class Test {
	public static void main(String[] args) {
		int[] ia = new int[3];
		int[] ib = new int[6];
		System.out.println(ia.getClass() == ib.getClass());
		System.out.println("ia has length=" + ia.length);
	}
}

produces the output:


true
ia has length=3

This example uses the method getClass inherited from class Object and the field length. The result of the comparison of the Class objects in the second println demonstrates that all arrays whose components are of type int are instances of the same array type, which is int[].