public static <T, U extends Comparable<? super U>> Comparator<T> comparing( Function<? super T, ? extends U> keyExtractor) { Objects.requireNonNull(keyExtractor); return (Comparator<T> & Serializable) (c1, c2) -> keyExtractor.apply(c1).compareTo(keyExtractor.apply(c2)); }
The part I'm interested in is this: return (Comparator<T> & Serializable)
Thanks for your help!
The word the is considered a definite article because it defines the meaning of a noun as one particular thing. It's an article that gives a noun a definite meaning: a definite article. Generally, definite articles are used to identify nouns that the audience already knows about.
It is the definite article in English.
The definite article (the) is used before a noun to indicate that the identity of the noun is known to the reader. The indefinite article (a, an) is used before a noun that is general or when its identity is not known. There are certain situations in which a noun takes no article.
"I Love You" (8 letters, 3 words, 1 meaning) is the most common definition for 831 on Snapchat, WhatsApp, Facebook, Twitter, Instagram, and TikTok. 831. Definition: I Love You (8 letters, 3 words, 1 meaning)
This means that the resulting value will be cast to Comparator
and Serializable
(i.e. a serializable comparator)
Note that when doing casts like this one, you're allowed to specify only one class (and infinite amount of interfaces), because it's not possible for a class to inherit from more than one super-class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With