2014-01-06 49 views
2

我認爲以下是正確的,但try.dart發出錯誤。Dart,try.dart使用Mixins給出錯誤

abstract class Persistence{ 
    void save(String stuffToSave){ 
     print('Saved ' + stuffToSave); 
    } 
} 
class Car { 
    String model; 
    int speed; 
    Car(this.model, this.speed); 

    void accelerate(int increase){ 
     this.speed+=increase; 
    } 
} 

class Truck extends Car with Persistence { 
    Truck(String model, int speed):super(model, speed); 
} 

main(){ 
    Truck myTruck = new Truck('big truck', 0); 
} 

以下是錯誤: enter image description here

回答