// To simplify the implementation, I'm making the attributes "protected". // This means they will be accessible to other classes in the same // directory, but not accessible from beyond the directory containing // this file. This will save us having lots of cumbersome get/set methods. // To make the implementation general, we say that the node contains some // "Item" object, which presumably extends the Object class to provide // an implementation of equals() and toString(). public class Node { protected Node prev; protected Node next; protected Item data; public Node(Item value) { prev = null; next = null; data = value; } }