/** An instance of this class contains a reference to an object of the ** specified type T (the generic type parameter) and a reference to ** an object of the same kind (i.e., Link1). The idea is that objects ** of this class can be used as building blocks to form one-directional ** linked structures (i.e., one-way lists). ** ** Author: R. McCloskey */ public class Link1 { // instance variables // ------------------ public T item; public Link1 next; // constructors // ------------ /* Initializes this Link1 object so that its two fields contain the ** specified values. */ public Link1(T item, Link1 next) { this.item = item; this.next = next; } /* Initializes this Link1 object so that its 'item' field contains the ** specified value and its 'next' field is null. */ public Link1(T item) { this(item, null); } /* Initializes this Link1 object so that both its fields are null. */ public Link1() { this(null, null); } }