Storing Doubles with a string - Java
So I seemed to have run into a slight problem. I am attempting to store
some doubles with a string (acting like a name for the them), then be able
to sort them in descending order.
I would also like to store them in someway, like a hashmap, arraylist,
list etc... I'm not to sure on which would be the best.
Kind of like Lets assume these are stored in some way like a hashmap, list
etc...
Bob: 6.0
Mary: 5.4
Bill: 6.3
Ann: 5.0
Jim: 6.0
Then output them to something like:
Bill: 6.3
Bob: 6.0 //Notice, it must be able to support duplicates.
Jim: 6.0
Mary: 5.4
Ann: 5.0
I hope this makes sense to others, if not let me know and I can try to
clear it up.
P.S. I looked for other threads like this but could not find one that
suits my needs.
No comments:
Post a Comment