Please enable JavaScript.
Coggle requires JavaScript to display documents.
Generics - Coggle Diagram
Generics
Benefits of Generics
Stronger Type Checks
Casting isn't required
Writing Generic Algorithms
Generics don't work with Primitives
Link Title
Type parameters are erased when generic classes are compiled
A generic class with the type parameter can't have static members
Bounded Type Parameters
<T extends Superclass>
A type parameter can have multiple bounds
If the other bounds are mix of Class and Interface, Class should be mentioned first
Wildcards
Upper Bounded Wildcards
<? super BoundedType>
Lower Bounded Wildcards
<?>
Unbounded Wildcards
<? extends SuperClass>
Generic Class
Generic Interface
Generic Method
Type Erasure