/** Example 4 - creates a new Pile // shows that because myIntNode is null (not referencing anything) // you can't get myIntNode.value or myIntNode.next // shows that if we create a new IntNode, we can get myIntNode.next // and myIntNode.value */ public class TestPile2 { public static void main (String [] args) { Pile pile; IntNode myIntNode; pile = new Pile(); myIntNode = pile.getLast(); System.out.println (myIntNode); System.out.println (pile); // System.out.println (myIntNode.value); // System.out.println (myIntNode.next); myIntNode = new IntNode(); System.out.println (myIntNode); System.out.println (pile); System.out.println (myIntNode.value); System.out.println (myIntNode.next); } // end main } // end class