File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Help on java assignment. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
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: 1304
figure it out yourself
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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://aspose.com/file-tools
 
subject: Help on java assignment.