Monday, December 20, 2010

LinkedHashMap

Some insight on LinkedHashMap:

The Class LinkedHashMap is an extension of HashMap with specific feature of retaining the insertion order. Hence useful when order of key-value pairs are to be retained. Also if one inserts the key again into the LinkedHashMap the original orders is retained.

Such Collection is useful when you want to convert a record fetched from the database into a Java Object.

The main advantage with this is that now we can shift the sorting logic of retrieved data into database rather than writing custom code here; that help in boosting performance.

No comments:

Post a Comment