aspose file tools
The moose likes Beginning Java and the fly likes To get the value from the Sorted Array Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "To get the value from the Sorted Array" Watch "To get the value from the Sorted Array" New topic
Author

To get the value from the Sorted Array

kalpana Kumar
Ranch Hand

Joined: Jul 03, 2003
Posts: 65
Hi all,
I have a very basic question I have an array and I sorted the values using
Arrays.sort method. But I am not able to figure out as to how to retrieve the individual sorted values?
Example:
static int[] test1={3,10,1,2,19,0}
Arrays.sort(test1);
Say, if I have 2 arrays and I have to compare values individually then it be easier if I sort them. But how to compare the individual values.
Are there any samples regarding the same.

Any suggestion is appreciated.

Thanks
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1815
Access the member of the array with the [] as such:



Remember, arrays are zero-indexed, meaning the first element is a position 0, not 1.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: To get the value from the Sorted Array
 
Similar Threads
Optimized way of finding duplicate elements in the array?
Comparable and Comparator
question on array and printing
problem with sorting an array...
How to check StringArray is sorted or not?