28. Rectangle
class Rectangle extends Shape
{
void redraw()
{ // commands for drawing a rectangle }
// possibly, more methods and variables }
•Oval
class Oval extends Shape
}
void redraw)(
}//commands for drawing an oval}
//possibly, more methods and variables"}
29. RoundRect
class RoundRect extends Shape
{
void redraw() {
// commands for drawing a rounded rectangle
}
// possibly, more methods and variable
}
30. redrawshape
Shape myShape = new Shape();
myShape.redraw();
redrawRectangle
Rectangle myRectangle = new Rectangle();
myRectangle.redraw();