Multiple generic interface separator: "," or "&"
I was always using A<T extends I1, I2>
but today, I saw A<T extends I1 & I2>
.
What is the difference between these two notation?
Does it have a different meaning? Purpose?
Use double quotation marks (“”) around a direct quote. A direct quote is a word- for-word report of what someone else said or wrote. You use the exact words and punctuation of the original. Harriet Jacobs writes, “She sat down, quivering in every limb” (61).
Quotation marks are most often used to mark something that is spoken or, in other words, to designate a direct quote. That is, they display something that's been said, word for word.
Single quotation marks are also known as 'quote marks', 'quotes', 'speech marks' or 'inverted commas'. Use them to: show direct speech and the quoted work of other writers.
Quotation marks can be double ("...") or single ('...') - that is really a matter of style (but see below for more about this). Quotation marks are also called "quotes" or "inverted commas".
A<T extends I1, I2>
is a type A
with two parameters
T
which must be a subtype of I1
I2
You can read this as "A <preposition> type T which extends I1 <preposition> type I2",
so SortedMap<Key extends comparable, Value>
is a "map from comparable type key to type value"
A<T extends I1 & I2>
is a type A
with a single parameter
T
which must be a subtype of I1
and a subtype of I2
You can read this as "A <preposition> type T which extends I1 and I2" so a SortedSerializableSet<T extends Serializable & Comparable>
can be read "a sorted set of elements of type T which is both serializable and comparable"
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