How to store employee records with out any duplication, in such a way that it should be in insertion order? which collection framework class to use?
Since you don't want duplicated records, then you choose sets.
But again if you want to read in the insertion order choose LinkedHashSet specifically. It will store in insertion order.
Note : Don't use Lists because it allows duplication.
Don't use maps, because it stores and retrieves in random order.
Back To Top