I read here @ java.sun that int[] iarr is a primitive array and int[][] arr2 is a object array. What is the difference between a primitive type and an object type ? How are the above two different from each other ?
I read here @ java.sun that int[] iarr is a primitive array and int[][]
Share
int[]is a primitive array because it contains elements of primitive typeint. Every array itself is Object, so array of primitives is object too.int[][]is a array ofint[], i.e. each element ofint[][]contains array of integers. But since array is a objectint[][]contains objects, not integers.