main(List<String> args) {}
class Animal {
int age;
Animal(this.age);
}
class Person extends Animal {
String name;
// 可以通过快速修复来创建
Person(int age) : super(age);
// 手动创建
// Person(this.name, int age) : super(age);
}
main(List<String> args) {}
class Animal {
int age;
Animal(this.age);
}
class Person extends Animal {
String name;
// 可以通过快速修复来创建
Person(int age) : super(age);
// 手动创建
// Person(this.name, int age) : super(age);
}
本文标题:15.Dart类的简单继承
本文链接:https://www.haomeiwen.com/subject/vyriahtx.html
网友评论