Tags
#bloch-effective-java-2ed #java #java-generics
Question
How would you fix the declaration using PECS rule?
public static <T extends Comparable<T>> T max(List<T> list)
Answer
public static <T extends Comparable<? super T>> T max(List<? extends T> list)
Tags
#bloch-effective-java-2ed #java #java-generics
Question
How would you fix the declaration using PECS rule?
public static <T extends Comparable<T>> T max(List<T> list)
Tags
#bloch-effective-java-2ed #java #java-generics
Question
How would you fix the declaration using PECS rule?
public static <T extends Comparable<T>> T max(List<T> list)
Answer
public static <T extends Comparable<? super T>> T max(List<? extends T> list)
If you want to change selection, open document below and click on "Move attachment"
pdf
owner:
piotr.wasik - (no access) - Effective Java (Joshua Bloch), 2ed, p138
Summary
status | not learned | | measured difficulty | 37% [default] | | last interval [days] | |
---|
repetition number in this series | 0 | | memorised on | | | scheduled repetition | |
---|
scheduled repetition interval | | | last repetition or drill | | | | |
---|
Details
No repetitions