void main() { Square square = Square(100.0, 200.0); print(square.area()); } abstract class Shape { double width; double height; double area(); } class Square extends Shape { Square(double width, double height) { this.width = width; this.height = height; } @override double area() { return super.width * super.height; } }
部分素材资源来源网站,本站提供免费下载,如有侵权请联系站长马上删除!