import cs101.io.Console; import cs101.lang.*; /** * A simple self-animating object. */ public class SimpleAnimate implements Animate { // The thread which animates this object. private AnimatorThread mover; /** * Creates a new SimpleAnimate object. */ public static void main(String[] args) { SimpleAnimate sa = new SimpleAnimate(); } /** * Class constructor. Creates a new AnimatorThread * to execute this object's act() method, and starts * the thread's execution. */ public SimpleAnimate() { this.mover = new AnimatorThread(this); this.mover.startExecutuion(); } /** * Implementation of the Animate interface. */ public void act() { Console.println("Acting."); } }