java array of size - code example Example 1: length of array in java arr.length; Example 2: array declaration and initialization in java int[] age = new int[5];