Saturday 15 June 2013

java - Comparator compare() method sorting confusion -


I am self-test questions from Cathy and Serera Book. One question went wrong, so I was trying in the IDE. The main question I can get from this image is that the main question is when I debug it, then I had a debugging point compared to the method. If tooltip can be seen that O1 value is pen I thought that O1 should be map and O2 should be pen. Can anyone explain this illusion to me?

comparative illusion

You can see the source of arrays.sort method on grepcode and it can now understand better:


No comments:

Post a Comment