public class CreativeRobotOwner { private Robot harry, sally; public CreativeRobotOwner() { // creating harry // first, we create new wheels for harry Stepper wheels = new Wheels(); // then, we create a new Robot using the new wheels, // and the color pink, and refer to it as harry harry = new Robot( wheels, java.awt.Color.pink ); // creating sally // create new feet, whiskers and tail for sally Stepper feet = new Feet(); Whiskers w = new Whiskers(); Tail t = new Tail(); // create a new blue FeelingRobot with Feet, Whiskers, and a Tail sally = new FeelingRobot( feet, java.awt.Color.blue, w, t ); // turn him on. harry.switchOn(); sally.switchOff(); // Oh, I'm bored. Sleep for a while. try { Thread.sleep( 30*60*1000 ); // sleep for 30 minutes. } catch ( InterruptedException e ) { System.out.println( "Hey! Who woke me up?!!" ); } // oops! I forgot to turn harry off before I slept! // better do it now. harry.switchOff(); sally.switchOff(); } }