Answer:
Check the explanation
Step-by-step explanation:
public class EnhancedForExample {
public static void main(String[] args) {
int[] arr = {4, 2, 9, 1, 5, 7};
for(int num : arr) {
System.out.println(num);
}
}
}
Kindly check the attached image below for the code output.