First of all I am a student, I'm in a data structures class.

Well I'm having trouble coming up with a getNext method to be used in a linked list class. I am trying to write a getNext method that I can to find out if the list contains a certain int.
I'm not sure if that is a good enough description... just trying to find out how to work my way through a linked list really, I can't seem to figure it out!

Keep in mind that each node in a LinkedList contains a "NEXT" pointer, which points to the next node and/or a "previous" pointer which points to the previous node. You may set-up a Node class which contains the element of that node and the pointers:

public class Node{
    Node next;
    Node prev; //this is optional 
    Object element; //this could be any types 
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.