Generics
Josh Bloch Generics JavaOne 2006
Generics vs. Autocasting
Explicitly provide type by passing in class, see bottom of page
method generics
public abstract void getAndParse(T paramAnotherClass);
public void addFriend(String name, Class type, T animal);
- Builder pattern / Static Factories
- klass.cast(...)
- Sparse Array
- Serialization Proxy
- Use private and final unless reason not
Generics vs. Autocasting
Explicitly provide type by passing in class, see bottom of page
method generics
public abstract
public
Comments