VOOZH about

URL: https://www.geeksforgeeks.org/java/java-iterate-array-in-reverse-order/

⇱ Java - Iterate Array in Reverse Order - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Java - Iterate Array in Reverse Order

Last Updated : 23 Jul, 2025

In Java, iterating over an array in reverse order means accessing the elements of the array from the last to the first. We have multiple ways to iterate an array in reverse order.

Example 1: The most simplest way to iterate over an array in reverse order is by using a for loop.


Output
50 40 30 20 10 


Example 2: The other method is using an enhanced for loop, where we first reverse the array and then iterate directly on the elements.


Output
50 40 30 20 10 

Example 3: We can also use a while loop to iterate over an array in reverse order. This method is similar to the for loop but uses a condition explicitly.


Output
50 40 30 20 10

Example 4: We can also use the Streams API in Java 8 and later, which provides a concise way to iterate over an array in reverse order.


Output
50 40 30 20 10 
Comment
Article Tags:
Article Tags: