// 將下列程式碼存檔: mixinclass.dart
abstract class A { call() => print("A") ; }
abstract class B { call() => print("B") ; }
class O { call() => print("Super"); }
class OxO extends O { call() => print("OxO") ; }
class ExO extends O { }
class MxB with B { }
class MBA with B,A { }
class MAB with A,B { }
main() {
OxO()..call();
ExO()();
MxB()();
MBA()();
MAB()();
}
執行 dart mixinclass.dart 看結果:
OxO
Super
B
A
B
沒有留言:
張貼留言