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

Consistent with equals

For proper behavior in sorted collections, compareTo should return zero exactly when equals returns true.

This lesson is for subscribers

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