Course contentsShow
Java
Lesson 1322 of 2,87030. Comparable and ComparatorPro lesson

Symmetry: sgn(x.compareTo(y)) == -sgn(y.compareTo(x))

Learn why reversing comparison order must flip the sign and what happens when it doesn't.

This lesson is for subscribers

You've completed the free preview. Subscribe to unlock every lesson in every course.