int[] in java code example Example 1: set array length java int[] num = new int[5]; Example 2: int[] int[] array; // is equivalent to int array[];