Today I found strange code in jdk8 sources and did not find any explanation.
static final Comparator<ChronoLocalDate> DATE_ORDER = (Comparator<ChronoLocalDate> & Serializable) (date1, date2) -> { return Long.compare(date1.toEpochDay(), date2.toEpochDay()); };
Can someone explain to me why and Serializable from <> ?
And it would be great to provide a link to the documentation.
Source Link: AbstractChronology
java generics java-8 interface
user2740884
source share