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

The nullsFirst() Method: Null-Safe Comparisons

Use Comparator.nullsFirst() to wrap a comparator so null values are always sorted before non-null values.

This lesson is for subscribers

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