java array length vs size code example Example 1: length of array in java arr.length; Example 2: Java length of array int arrayLength = arr.length;