arrays have no concept of negative indices, if you want to traverse from the last to first then you must START at the LAST index and move to the FIRST.

for(i =3; i>0; i--){

   System.out.println(var[i - 1]);

}
Answer from T McKeown on Stack Overflow
Discussions

java - Printing elements of array called top10 backwards - Stack Overflow
I am trying to write a code to print the elements of an array called top10 backwards. How would this be? Anything would be great as I have no clue how to begin. More on stackoverflow.com
๐ŸŒ stackoverflow.com
java - Printing number in an array backwards - Stack Overflow
I am new to java and I wondering how I could fix my program which has to take numbers from user input, then store them in an array, and then print those numbers forwards and then backwards. I have More on stackoverflow.com
๐ŸŒ stackoverflow.com
November 18, 2016
How to Print an array backwards using java

You can make a decrementing for loop.

//Array with 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10    

for (int i = nums.size() - 1; i >= 0; i--) {
    System.out.println(nums.get(i));
}
More on reddit.com
๐ŸŒ r/learnprogramming
2
1
June 8, 2016
java - I want to print my string array elements backwards? - Stack Overflow
I have created an array and i want to print the array elements backwards. I'm completely lost on how to do that. I was thinking I might need to convert this array to a char array. The example below... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Quora
quora.com โ€บ How-do-I-Print-reverse-of-an-array-in-java
How to Print reverse of an array in java - Quora
Answer (1 of 8): Well, what you have appears to be correct. What is it that bothers you about the code? Does it seem too simple? Well, doesnโ€™t it do precisely what you said you wanted to do? There are other ways to do it, but they would be more complicated.
๐ŸŒ
Software Testing Help
softwaretestinghelp.com โ€บ home โ€บ java โ€บ how to reverse an array in java: 3 methods with examples
How to Reverse An Array In Java: 3 Methods With Examples
March 24, 2020 - In this guide, youโ€™ll be learning three simple methods on how to reverse an array in Java, along with examples, in a way that is easy to understand. => Check Out The Ultimate Java Training Series Here ... Alternatively, if we want to print the array in the reverse order, without actually reversing it, then we can do that just by providing a for loop that will start printing from the end of the array.
๐ŸŒ
Quescol
quescol.com โ€บ home โ€บ java program to print array in reverse order
Java Program to Print Array in Reverse Order - Quescol
May 8, 2025 - The input array size is 5, so the โ€˜for loopโ€™ will executes the body 5 times taking input from the users as the elements of the array, which is {4,3,2,1,3}. The program returned the reverse of the input array i.e. {3,1,2,3,4}. import java.util.*; public class Main { public static void main(String[] args) { int startIndex,lastIndex; Scanner sc = new Scanner(System.in); System.out.print("Enter the size of array: "); int size = sc.nextInt(); int arr[] = new int[size]; int reverse[] = new int[size]; for(int i=0; i<size; i++) { System.out.print("Please give value for index "+ i +" : "); arr[i] = sc.nextInt(); } startIndex = 0; lastIndex = size - 1; while(lastIndex >= 0) { reverse[startIndex] = arr[lastIndex]; startIndex++; lastIndex--; } System.out.println("Array After Reversing :"); for(int i=0; i<size; i++) { System.out.print(reverse[i]); } } }
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ reverse an array in java
Reverse an Array in Java - Scaler Topics
April 28, 2024 - In the above program, we are accessing the elements of the array in reverse order along with simultaneously printing them on the screen.
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ reverse-an-array-in-java
Reverse an Array in Java - GeeksforGeeks
July 11, 2025 - // Java Program to reverse an array // using loop import java.util.Arrays; public class Geeks { public static void main(String[] args) { int[] arr = {1, 2, 3, 4, 5}; // Swap elements from start to end for (int i = 0; i < arr.length / 2; i++) { int t = arr[i]; arr[i] = arr[arr.length - 1 - i]; arr[arr.length - 1 - i] = t; } System.out.println("" + Arrays.toString(arr)); } }
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ java-iterate-array-in-reverse-order
Java - Iterate Array in Reverse Order - GeeksforGeeks
July 23, 2025 - // Java Program to iterate over ... 40, 50}; // Reversing the array Collections.reverse(Arrays.asList(arr)); // Iterating over the reversed array for (int n : arr) { System.out.print(n + " "); } } }...
๐ŸŒ
Techcrashcourse
techcrashcourse.com โ€บ 2018 โ€บ 12 โ€บ java-program-to-reverse-array-elements-using-loop.html
Java Program to Reverse Array Elements
Declare another array of size N, let it be "reverseArray". Using a for loop, copy elements from inputArray to reverseArray in reverse order. For example, copy last element of inputArray to first position of reverseArray and so on. Now, using a for loop, traverse reverseArray from index 0 to ...
๐ŸŒ
CodeGym
codegym.cc โ€บ java blog โ€บ java arrays โ€บ reverse an array in java
Reverse an Array in Java
January 16, 2025 - As a result the reverse order of ... reverse : [25, 16, 9, 4, 1] In Java, the reverse method, which is part of the existing Collections framework, can be used to reverse an array....
๐ŸŒ
Medium
medium.com โ€บ @AlexanderObregon โ€บ reversing-the-order-of-an-array-with-java-loops-95b3546e023b
Reversing the Order of an Array with Java Loops | Medium
September 7, 2025 - Learn how to reverse arrays in Java by looping from the end back to the start. Covers memory layout, index control, printing, storing, and swapping values.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 50918843 โ€บ printing-elements-of-array-called-top10-backwards
java - Printing elements of array called top10 backwards - Stack Overflow
you start from last 10 by setting initial index = 9, for (var i = array.length-1; i >= 0 ; i--) console.log(array[i]) ... You start at 0 and loop to 9 and request the indices in reverse order (ie top10[top10.length - index - 1] or you could loop from 9 down to 0 printing each element. Take a look at The for Statement for more details ... int topTenBackwards[] = new int[] {1,2,3,4,5,6,7,8,9,10}; for(int i = topTenBackwards.length - 1; i >= 0 ; i--) { System.out.println(topTenBackwards[i]); }
๐ŸŒ
LearnYard
read.learnyard.com โ€บ dsa โ€บ print-array-in-reverse-order
Print Array in Reverse Order Solution in C++/Java/Python/JS
May 11, 2025 - // Function to print each element of the array in reverse order function printArrayInReverse(nums, size) { for (let index = size - 1; index >= 0; --index) { process.stdout.write(nums[index] + " "); } console.log(); // Newline for better output ...
๐ŸŒ
Java Concept Of The Day
javaconceptoftheday.com โ€บ home โ€บ how to reverse an array in java?
How To Reverse An Array In Java?
June 9, 2016 - Step 1 : Let inputArray be the given array. Step 2 : Iterate over only half of the inputArray (inputArray.length / 2). For every ith element, swap it with (inputArray.length-1-i)th element. for (int i = 0; i < inputArray.length/2; i++) { temp = inputArray[i]; inputArray[i] = inputArray[inputArray.length-1-i]; ... Step 3 : Print inputArray. import java.util.Arrays; public class ArrayReverseExample { static void reverseArray(int inputArray[]) { System.out.println("Array Before Reverse : "+Arrays.toString(inputArray)); int temp; for (int i = 0; i < inputArray.length/2; i++) { temp = inputArray[i]
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ dsa โ€บ program-to-reverse-an-array
Array Reverse - GeeksforGeeks
#include <stdio.h> #include <stdlib.h> void reverseArray(int arr[], int n) { // Temporary array to store elements // in reversed order int temp[n]; // Copy elements from original array // to temp in reverse order for(int i = 0; i < n; i++) temp[i] = arr[n - i - 1]; // Copy elements back to original array for(int i = 0; i < n; i++) arr[i] = temp[i]; } int main() { int arr[] = { 1, 4, 3, 2, 6, 5 }; int n = sizeof(arr) / sizeof(arr[0]); reverseArray(arr, n); for(int i = 0; i < n; i++) printf("%d ", arr[i]); return 0; } ... import java.util.Arrays; class GfG { static void reverseArray(int[] arr) {
Published ย  5 days ago
๐ŸŒ
Tpoint Tech
tpointtech.com โ€บ java-program-to-print-the-elements-of-an-array-in-reverse-order
Java Program to print the elements of an array in reverse order - Tpoint Tech
September 1, 2025 - In this section, we are going to solve another popular coding problem that was asked by e-commerce companies Flipkart and Amazon. Also, we will solve the problem with different approaches and create Java programs.