Variable Scope


Class Structure: State & Constructors

 
/** Class documentation goes here.
 */
public class TalkingRobot
{
  // State: instance variables go here.
    private Clock clock;
    private Random generator;

  // Constructors

    /**  Constructs a new TalkingRobot object.
     *      @param  aClock    clock to be used by robot
     */
    public TalkingRobot(Clock aClock)
    {
        // initialise instance variables
        this.clock = aClock;
        this.generator = new Random();
    }

  // Methods

    // methods are not shown here...

}

Alyce Brady, Kalamazoo College