Question 13
Back to Exercise
for (int x : arr) x = 0; – what happens to arr?
- A All elements become 0
- B Nothing – x is a copy of each element Correct
- C A compile error
- D An exception
Correct Answer: Option B
Use an index loop to assign elements.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!