Nilesh Pat wrote:properties file will have order in which we need to arrange the list.
For eg.
0=pritam...
What, it contains the
physical position of every single name you may receive? Seems like a
very odd setup to me; but perhaps it's just a class exercise...
So, the order of the names looks like it's defined by the order of their associated "number", which you could determine by putting those values in a Map (java.util.Map) and having your Comparator access it.
However: before you write
anything, I'd think very hard about what to do if you get a name that
isn't in your list. Simplest is probably just to throw an Exception, but there are other alternatives.
Winston