// This class demonstrates object state. Multiple // calls to a particular parent object's areWeThereYet() // method yields different strings. public class Parent { private int count; private int threshold; public Parent(int threshold) { count = 0; this.threshold = threshold; } public String areWeThereYet() { count++; if (count >= threshold) { return "NO!!!! Now sit down and shut up, you ungrateful little brat!"; } else if (count % 2 == 0) { return "We'll be there soon"; } else { return "We're almost there"; } } }