Java - Array's length property
- by The New Idiot
We can determine the length of an ArrayList<E> using its public method size() , like
ArrayList<Integer> arr = new ArrayList(10);
int size = arr.size();
Similarly we can determine the length of an Array object using the length property
String[] str = new String[10];
int size = str.length;
Whereas the size() method of ArrayList is defined inside the ArrayList class , where is this length property of Array defined ? Is it implemented by JVM or does it reside in any Java API class file ?