X336: iterateOverList

Consider the following class definition:
   class Link{
      Object data;
      Link next;
Write a while loop to make q refer successively to each Node in the linked list headed by p. q must end up referring to the last Node in the list. Given that the list L contains the elements [,,,] and p and q both point to the first '_'.

Initial Setup Final Configuration

Your Answer:


Practice a different Java exercise


Your feedback will appear here when you check your answer.