Data Structures & Algorithms Lecture Notes

24 September 2010 • Generics in Practice


Outline

Polymorphism

Generics

Generic Type Variables

Generic Class Names

Using Type Variables

Implementing Generics via Erasure

Erasure Example.

Erasure Example..

Erasure Example...

Erasure Example....

Observations

Generics vs new

Generics vs Primitives

Generics vs static

Curious Beasts

Among Generic Classes

Generics vs. Inheritance

Violating Run-time Guarantees

Example

Erasure Strikes Again

Type (In)Compatibility

Polymorphism Exiled

Wildcards

Wildcard Properties

Generics Hierarchy

misbegotten family trees

When Types Matter

Bounded Wildcards

Bounded Wildcard Properties

Bounded Type Variables

Multiple Bounds

Summary


This page last modified on 22 September 2010.

Creative
    Commons License