Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Compile All: the Rectangle file is automatically saved and recompiled.
  • To create an instance of class Rectangle, type the following in the Interactions pane:
    Code Block
    Rectangle r = newRectangle(4,5);
    
    Note: the "Compile All" command resets the Interactions pane erasing all extant
    definitions of names bound to objects. So when we compiled our new definition for the Rectangle class,
    we destroyed our first binding of r in the Interactions pane.
  • To "ask" the Rectangle object bound to r2 to compute its area, type
    Code Block
    r2.area();
    
    in the Interactions pane.
  • Experiment with the DrJava Interactions pane to create some new rectangles and computer their areas.

...