Java Reference
In-Depth Information
show the declaration of a class called MyClass that implements IGenIF .
The solution is
10 . Given a generic class called Counter<T> , show how to create an object of its raw
type.
To obtain Counter<T> 's raw type, simply use its name without any type specifica-
tion, as shown here:
11 . Do type parameters exist at run time?
No. All type parameters are erased during compilation, and appropriate casts are sub-
stituted. This process is called erasure.
12 . Convert your solution to question 10 of the Self Test for Chapter 9 so that it is gener-
ic. In the process, create a stack interface called IGenStack that generically defines
the operations push( ) and pop( ) .
Search WWH ::




Custom Search