Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Re: Singly Linked List of Integers, get(int i) function throws Null Pointer Exception

    I don't think a circular list would work. Say you have a list with one element and the user asks for the 10th element what element would you return?
    How do other containers like ArrayList handle it...
  2. Re: Singly Linked List of Integers, get(int i) function throws Null Pointer Exception

    You want a circular list? The end node points to the first node.
    That would keep you from running off the end of the list.
  3. Re: Singly Linked List of Integers, get(int i) function throws Null Pointer Exception

    Please copy and paste here the full text of the error message.

    What variable is null at the line where the error occurs?
    If you can't see it easily, add a println in front of the statement to...
Results 1 to 3 of 3