how to initialize an array using for loop in java code example Example: array declaration and initialization in java int[] age = new int[5];