Poll 10-13: Using Generics

Generics Poll 1

Day 1 Poll

Consider the generic Pair class below.

Which statements below are appropriate uses of generics? An appropriate use of generics will compile and avoid the use of raw types. Select all that apply. Assume each option is independent of the others.

hide circle
hide empty members
set namespaceSeparator none
skinparam classAttributeIconSize 0
skinparam classAttributeIconSize 0
skinparam genericDisplay old
skinparam defaultFontName monospaced
skinparam defaultFontStyle bold

skinparam class {
  BackgroundColor LightYellow
  BackgroundColor<<interface>> AliceBlue
}

class Pair<K,V> {
    + <<new>> Pair(key: K, value: V)
    + getKey(): K
    + getValue(): V
    + <<override>> toString(): String
    + <<override>> hashCode(): int
    + <<override>> equals(o: Object): boolean
}