Reverse array = possible?
843789Jun 30 2010 — edited Jul 3 2010Hi guys,
I am learning the arrays these days, so far so good i must add (atleast that my rating of myself lol). Anyway, i was wondering if it is possible to have a reverse array? For example we have an array with 1,2,3 elements and we want to print it (or save it to another array) in order 3,2,1?
So far i thought of this (made a reverse for loop i think, dunno if i wrote it right?)
public class provim1 {
public static void main(String args[]){
int num[] = {1,2,3};
for(int i = num.length; i < 0; i--){
System.out.println(num);
}
}
}
I am getting nothing out of this and it's been bugging me today. Any help is appreciated.
Edited by: Eduu on Jun 30, 2010 11:54 PM