public class ListNodeClient { public static void main(String[] args) { ListNode start = new ListNode(3); start.next = new ListNode(5); start.next.next = new ListNode(2); ListNode current = start; while (current != null) { System.out.println(current.data); current = current.next; // Same as: x = x + 1; } /* Hunter: This is very similar to array loop code (see slides) * * int i = 0; * while (i < array.length) { * //for (int i = 0; i < array.length; i++) { * System.out.println(array[i]); * i++; * } */ } }