Sorting Arrays - help needed

I have an array of 45 different numbers and i want to put them in descending or ascending order. these are the numbers:

main```````sub

1````````````574.7

2````````````184.34

3````````````129.52

4````````````240.96

5````````````446.99

etc.

i can arrange the sub numbers in order but i want the main numbers in the same order as the sub. can anyone point me to the right method?

thnx.

[457 byte] By [Chrisdigitya] at [2007-11-27 4:53:39]
# 1
what did you mean with (main/sub) combination?if you want to store your number in a key/value fasion, you can use any implementation class of the Map interface.give more explanation to get more help.Ahmad Elsafty
NourElsaftya at 2007-7-12 10:08:09 > top of Java-index,Java Essentials,Java Programming...
# 2

i have two sets of arrays. one is in order of 1 to 45 and the other is mixed numbers but they are linked. the main and sub hasn't got anything to do with the script or anything.

i want to know how to get the right hand side numbers in any order and the left hand side numbers in the same order as what u have put the right hand side in

Chrisdigitya at 2007-7-12 10:08:09 > top of Java-index,Java Essentials,Java Programming...
# 3

Java Collection framework provides us with an interface called Map. which can store elements in a key/value pair fasion.

Map interface has many implementation classes, but I think you need to use TreeMap class which sort its keys according to the natural ordering.

you can refere to docs page:

http://java.sun.com/j2se/1.5.0/docs/api/index.html

NourElsaftya at 2007-7-12 10:08:09 > top of Java-index,Java Essentials,Java Programming...
# 4
Thanks for that
Chrisdigitya at 2007-7-12 10:08:09 > top of Java-index,Java Essentials,Java Programming...