The reference type is ? super Dog, so it can be Dog also.
Larsen Raja wrote:Hi,
From my understanding, List based collections are itself not designed to hold unique elements. So there should be no specific method for doing this. Though you implement comparable or comparator, you have no specific implemenation to avoid duplicates. You can implement compareTo method, see if result is 0 and then remove manually which obviously involves for loop.
hth,
Larsen.
Sylvain Bouchard wrote:
This assignment works cause the value 12 is small enough to be hold by a short.
Remember that a short can hold a value from -32768 à 32767.