/** An example client of ListNode that prints out * all of the nodes in the list. * * @author Adam Blank */ public class ListNodeClient { public static void main(String[] args) { ListNode list = new ListNode(1); list.next = new ListNode(2, new ListNode(3)); ListNode current = list; while (current != null) { System.out.println(current.data); current = current.next; } } }