My thoughts did wander in this direction but was trying to avoid this route since it is, like you mentioned, "kind of dirty". The code made things easier for me.
Thanks!
Originalliy posted by Muhammad Ali:
For this I'd have to implement the sort method.
Can I assume that, because I didn't override the hashCode() of Object class in Employee class, LinkedHashSet is allowing duplicates.
In case If I want to create readonly arraylist object what can i do ?
so that by using ar.add("abc"); will given an unmodifiable exception