Java Enhanced For Loop
Q1.
The Enhanced For Loop in Java is also known as:
Q2.
Which of the following is the correct syntax for an Enhanced For Loop?
Q3.
What will be the output of the following code?
int[] nums = {1, 2, 3};
for (int n : nums) {
System.out.print(n + " ");
}
Q4.
Which of the following is a limitation of the Enhanced For Loop?
Q5.
Can we use the Enhanced For Loop to remove elements from a collection?