how to create array with values in java code example Example: set array length java int[] num = new int[5];