Thinking in Java 06(重复运用类)(汇总).pptVIP

  • 8
  • 0
  • 约1.22万字
  • 约 64页
  • 2020-09-08 发布于湖北
  • 举报

Thinking in Java 06(重复运用类)(汇总).ppt

//: c06:CADSystem.java ( p201 ) // Ensuring proper cleanup. import java.util.*; class Shape { Shape(int i) { System.out.println(Shape constructor); } void cleanup() { System.out.println(Shape cleanup); } } .......... * class Circle extends Shape { Circle(int i) { super(i); System.out.println(Drawing a Circle); } void cleanup() { System.out.println(Erasing a Circle); super.cleanup(); } } class Triangle extends Shape { Triangle(int i) { super(i); System.out.println(Drawing a Triangle); } void cleanup(

文档评论(0)

1亿VIP精品文档

相关文档