This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hero extends Character { | |
String hitMonster() { | |
return 'Take this..!'; | |
} | |
} | |
!------------------------------------------------------ | |
mixin DrinkAbility on Hero{ | |
String drink() => 'gluk...gluk...gluk...'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class FlyingMonster { | |
String fly(); | |
} | |
abstract class SwimingMonster { | |
String swim(); | |
} | |
abstract class Monster extends Character { | |
String eatHuman() { | |
return 'Grr.. Delicious ..'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementasi Abstract Class | |
// Abstract_Class_Pointer = Name of abstract_Class | |
abstract class Bicara{ | |
void say(); | |
} | |
class HelloWorld Extends Bicara { | |
@override | |
void say() { | |
print('something'); | |
} |