// Main program // With apologies to Dr. Seuss :-) public class CatInTheHat { public static void main(String[] args) { Thing thingOne = new Thing(); thingOne.print("1. thingOne"); // 1 thingOne = new Thing(33); thingOne.print("2. thingOne"); // 2 thingOne = new Thing(66, 99); thingOne.print("3. thingOne"); // 3 Thing thingTwo = new Thing(11, 22); thingTwo.print("4. thingTwo"); // 4 thingTwo.setA(111); thingTwo.print("5. thingTwo"); // 5 thingTwo.setB(222); thingTwo.print("6. thingTwo"); // 6 thingTwo.setA(thingOne.getA()); thingTwo.setB(thingOne.getB()); thingTwo.print("7. thingTwo"); // 7 // Use the class name as a prefix to // refer to static variables or methods System.out.println( "8. Object count: " + Thing.getObjectCount()); // 8 } }