java array variable length parameter code example Example: set array length java int[] num = new int[5];