Similar presentations:
Конструирование ПО. Семинар 6: Generics, PECS, Wildcards, Type erasure
1.
Конструирование ПОСеминар 6: Generics, PECS, Wildcards, Type erasure
Хохлов Игорь Дмитриевич, приглашённый преподаватель ФКН НИУ ВШЭ
2.
TT
T
T
extends
super
Generics
3.
Generics4.
Generics5.
Generics6.
Generics7.
Generics8.
CovarianceGenerics
9.
InvarianceGenerics
10.
Wildcards <?>Generics
11.
Producer extends, consumer superPECS
Generics
12.
Hierarchy (B2 extends A1, …)PECS: hierarchy
Generics
13.
List<? extends C2> list = …;PECS: extends
Generics
14.
List<? super C2> list = …;PECS: super
Generics
15.
class A class B class CPECS: hierarchy
Generics
16.
List<? extends T> list reading and assigningPECS: extends
Generics
17.
List<? super T> list writing and assigningPECS: super
Generics
18.
Collections.copy(List<? super T>, List<? extends T>)PECS: practice
Generics
19.
<T extends Object & Comparable<? super T>>PECS: practice
Generics
20.
<?>Generics
21.
<?>Generics
22.
«Wildcard Capture» pattern<?> Oracle Docs
Generics
23.
PECS: testGenerics
24.
PracticeGenerics
25.
PracticeGenerics
26.
PracticeGenerics
27.
Type erasureGenerics
28.
Type erasureGenerics