Java Reference
In-Depth Information
20
Generic Classes and
Methods
…our special individuality, as
distinguished from our generic
humanity.
—Oliver Wendell Holmes, Sr.
Born under one law, to another
bound.
—Lord Brooke
Objectives
In this chapter you'll:
Create generic methods that
perform identical tasks on
arguments of different types.
Create a generic Stack class
that can be used to store
objects of any class or
interface type.
Undestand compile-time
translation of generic
methods and classes.
Understand how to overload
generic methods with
nongeneric methods or other
generic methods.
Understand raw types.
Use wildcards when precise
type information about a
parameter is not required in
the method body.
 
 
Search WWH ::




Custom Search