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; } }
dart笔记7:dart abstract抽象类
dart笔记7:dart abstract抽象类: