Change the primitive int
to the type variable, E
,
and change the type of the pointer p
.
// get the value at index of the list // E get( int index ) throws IndexOutOfBoundsException { if ( isEmpty() ) . . . . GenericNode<E> p = headPtr; . . . .
It might be worthwhile to further modify the testing program to test this new method.
Select a few of the following topics to review: