aspose file tools
The moose likes Beginning Java and the fly likes Help on java assignment. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Help on java assignment." Watch "Help on java assignment." New topic
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
    
  13

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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Help on java assignment.
 
Similar Threads
array problem
Passing array to CallableStatement
Swap sublist of an arraylist with the sublist of another arraylist
How to write retrieved data into javascript Array?
Adding up the elements of two arrays and putting the resulting sum in another array