This week's book giveaway is in the Performance forum. We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line! See this thread for details.
Can 1 same comparator works for Double and String object type's like this ?
posted 7 years ago
this was my original comparator. And it is working.
As my requirements came in, what i did is added a new BOLD code as shown below.
Is it a right thing to do or better i should create a new Comparator ? My old comparator code is for Double value's and my new code added
is for String. Please i don't want to modify the existing code.
this is the new code i added above. it will return from here only when condition comes for my code