//: object/E05_DataOnly2.java
/****************** Exercise 5 ******************
* Modify Exercise 4 so the values
* of the data in DataOnly are assigned to and
* printed in main().
************************************************/
package object;
class Shape
{
Shape(int i)
{
System.out.println("Shape 构造啦!");
}
void dispose()
{
System.out.println("Shape dispose");
}
}
class Circle extends Shape
{
Circle(int i)
{
super(i);
System.out.println("Drawing Circle");
}
@Override
void dispose()
{
System.out.println("Erasing Circle");
super.dispose();
}
}
class Triangle extends Shape
{