0
Array
how to fill an array and print in reverse order
1 Respuesta
+ 1
You can use:
public class Program
{
public static void main(String[] args) {
int[] a = { 2, 3, 4 };
int length = 0;
for (int element : a) {
length++;
}
for (int i = length - 1; i >= 0; i--) {
System.out.println(a[i]);
}
}
}