This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "reverse array" Watch "reverse array" New topic
Author

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.
Steve
 
wood burning stoves
 
subject: reverse array