Dart abstract 抽象类
抽象类 相当于协议 接口
1 | abstract class Animal { |
Animal an = Animal(); //抽象类 不能被实例化
继承抽象类
继承自抽象类必须实现抽象方法 继承自抽象类的属性不是必须实现
1 |
|
implements 声明、with
1 | class Cat implements Animal { |
- Post title:Dart abstract 抽象类
- Post author:xxxixxxx
- Create time:2020-12-27 11:54:00
- Post link:https://xxxixxx.github.io/2020/12/27/300-Dart基础5/
- Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.
Comments