抽象类实现多个接口
abstract class A {String name = "";printA();
}abstract class B {String name = "";printB();
}//一个类implements实现多个接口
class C implements A, B {@overrideString name = "";@overrideprintA() {// TODO: implement printAthrow UnimplementedError();}@overrideprintB() {// TODO: implement printBthrow UnimplementedError();}
}
main(){C c = C();c.printA();
}
mixin全新的特性,实现多继承

//mixin全新的特性,实现多继承
mixin A {String info = "A Info";num age = 0; //numberprintA() {print("A");}
}mixin B {printB() {print("B");}
}class Person {String name = "";num age1 = 0;Person(this.name,this.age1);printP() {print("name= ${this.name}---- age=${this.age1}");}
}class C with A, B {}class D extends Person with A, B {D(super.name, super.age);
}main() {var c = C();c.printA();print(c.info);var d = D("张三",20);d.printA();d.printP();//is 判断print(d is A);print(d is B);print(d is Person);print(d is Object);}