I have a HashMap with String keys and Integer values.
I want to get a string with the String keys in numerical order of their String values.
eg. if I have
Orange=1 apple=4 pear =2 grapefruit=3
I want the following String
apple, pear, grapefruit, orange.
I'm not sure how to do this. Any help would be much appreciated.

you can't. Map's aren't sorted.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.