This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
In my application elements are added to a TreeMap.so whenever we are retrieving elements are displaying in the sorted order of keys.But i want to retrieve the elements in the order in which they are inserted.May i know which will be the correct choice now to do this order?
A collections class will display its elements in one order (or no particular order). They are not designed to display two different orders. If you want sorted order as well as insertion order, try your tree Map and a separate List, and add the same element to both. Or insert all your elements into the List and later pass both the key and value for every pair to the Map.