We can characterize recursively the operation of printing the elements of a list as follows:
Recursive implementation:
public static void print(ListNode lis, PrintStream ps) { if (lis == null) ps.println(); // base case else { ps.print(lis.info + " "); // process the first element print(lis.next, ps); // recursive call } }