Given the following code snippet:
int[] arr = {1, 2, 3};
for (int i : arr)
System.out.println(i);
I have the following questions:
- How does the above for-each loop work?
- How do I get an iterator for an array in Java?
- Is the array converted to a list to get the iterator?