Slide 77
Slide 77 text
$PQZSJHIU%&-J()5803,4*OD"MM3JHIUT3FTFSWFE
class Rectangle {
// ํܗ
public Rectangle(int x, int y, int width, int height) { … }
public void SetWidth(int width) { … }
public void SetHeight(int height) { … }
}
class Square : Rectangle {
// ํܗΛܧঝͯ͠ਖ਼ํܗ
public Square(int x, int y, int width, int height) { … }
public void SetWidth(int width) { … }
public void SetHeight(int height) { … }
}
ྫ͑ɺํܗΛܧঝͯ͠ਖ਼ํܗΛͭ͘Δ
ͦΕਖ਼͍͔͠ʁ