how to set int var = arr[i] code example Example: array declaration and initialization in java int[] age = new int[5];