Java Util Linked List - how to find next?
- by drozzy
When using Java LinkedList how do you find out the element's next or previous relationships?
I mean, in a regular linked list I would do something like this:
Node node1 = new Node();
Node node2 = new Node();
LinkedList list = new LinkedList();
list.add(node1);
list.add(node2);
//then my node1 will know who it's next is:
assertEquals(node2,…