jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes reverse array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "reverse array" Watch "reverse array" New topic

reverse array

Gabriel White
Ranch Hand

Joined: Mar 02, 2003
Posts: 233
Hey Yall, long time no talk...
I'm trying to get this simple array reversal to work.
It correctly fills in all of the random numbers, but then I want it to output the same numbers in reverse order WITHOUT changing the for loop.
Here is my code. I know the last part is wrong, I have just been trying different ideas to get it to work.
I also know that I need to setup a temp variable and subtract 1 from the myArray array to print correctly. Something like that.
Thanks in advance.
Ramesh Donnipadu
Ranch Hand

Joined: Sep 16, 2000
Posts: 100
I guess you are trying to print the contents of the Array in reverse order. If so, could you try this?

[ January 13, 2004: Message edited by: Ramesh Donnipadu ]
Gabriel White
Ranch Hand

Joined: Mar 02, 2003
Posts: 233
Thanks Ramesh, I couldn't remember it. I had it typed out like that before, but I guess I just did something else wrong.
Thanks for your help.
I agree. Here's the link: http://aspose.com/file-tools
subject: reverse array
It's not a secret anymore!