Arrays are implemented as objects in java right? If so, where could I look at the source code for the array class. I am wondering if the length variable in arrays is defined
For every Array we declare, corresponding classes are there in Java but it's not available to us.You can see the classes by using getClass().getName()
int[] arr=new int[10];
System.out.println(arr.getClass().getName());
Output : [I
where "[" represents one dimension array and "I" represents Integer. Similarly, we can have
[F for one-dimensional float arrays
[Z for one-dimensional boolean arrays
[J for one-dimensional long arrays
[[I for two-dimensional int arrays
and so on.