go to previous page   go to home page  

Answer:

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.


Last Page

Select a few of the following topics to review:


go to previous page   go to home page