How do you iterate through an array in Java?
You can use a `while` loop to iterate through an array and print each element.
Thatâ€™s not quite right. While loops can be used, a `for` loop or `foreach` is generally preferred for simple iteration.
Can you show me how to use a `for` loop to iterate through an array in Java?