| Author |
Help on java assignment.
|
Troy Johnson
Greenhorn
Joined: Sep 24, 2003
Posts: 20
|
|
Hello. I am new to the java programming language. I am looking for some assistance on the following java problem. I am having some trouble figuring it out. Here it is: 1.Takes an array of integers as a parameter. 2.Creates a new integer arrays containing the reversal of the parameter array. 3.Return this new array. Can anyone offer any insight? Thanks.
|
 |
Uma Balu
Ranch Hand
Joined: Aug 22, 2003
Posts: 61
|
|
Hi Tony,
1. Takes an array of integers as a parameter.
Create a class. Declare a method which accepts an int array.
2. Creates a new integer arrays containing the reversal of the parameter array.
Inside the method, declare another int array of the same length. Traverse through the first array from the last index , take that value and assign it to the newly created array from the first index. Use two counters, one to count from back and one from front.
3. Return this new array.
Return the newly created array's reference. Hope this helps you, Uma...
|
 |
Billy Tsai
Ranch Hand
Joined: May 23, 2003
Posts: 1296
|
|
|
figure it out yourself
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24061
|
|
Troy -- Welcome to JavaRanch! Uma's answer sounds like it should be helpful. Billy -- Be nice!
|
[Jess in Action][AskingGoodQuestions]
|
 |
Troy Johnson
Greenhorn
Joined: Sep 24, 2003
Posts: 20
|
|
Thanks everyone for all of your assistance. I was able to figure out the problem with your help. Thanks again. It is greatly appreciated. Troy
|
 |
 |
|
|
subject: Help on java assignment.
|
|
|