This content has been marked as final. Show 4 replies
gimbal2 wrote:Sorry, but according to the JavaDoc Comparator.compare should return:
A compare should return one of three values: -1, 0 or 1. Where is the -1 case here? I'm surprised it worked before!
+"a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second."+
I would not rely on the fact that -1, 0 and 1 are the most used values.
But you are right, the negative value is missing.
Edited by: domi on 04.01.2013 14:46: Is ok to use to use -1, 0, 1 in a Comparator, but outside you should except negative or positive values or 0.