Skip to content

Instantly share code, notes, and snippets.

@zoytsa
Last active July 8, 2021 21:51
Show Gist options
  • Select an option

  • Save zoytsa/fb98b8ec40ceafe1c3d2bfc262aae144 to your computer and use it in GitHub Desktop.

Select an option

Save zoytsa/fb98b8ec40ceafe1c3d2bfc262aae144 to your computer and use it in GitHub Desktop.
skbx_hw_2_3
abstract class Hero {
void say();
}
mixin Fly {
void canFly(int mySpeed) {
print('Я могу летать со скоростью ${mySpeed} км/ч');
}
}
mixin Jump {
void canJump() {
print('Я могу прыгать');
}
}
class SuperMan extends Hero with Fly, Jump {
int speed = 60;
SuperMan(this.speed);
@override
say() {
canFly(speed);
canJump();
}
}
void main() {
SuperMan superMan = SuperMan(250);
superMan.say();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment