Reputation: 35
How come
int[] arr = new int[5];
Object[] obj = arr;
produces a compilation error while
int[][] arr = new int[5][5];
Object[] obj = arr;
doesn't?
Upvotes: 0
Views: 24
Reputation: 140318
int[]
is an Object
, so array of int[]
is an array of Object
.
Upvotes: 1