Created
March 14, 2024 08:16
-
-
Save dicenull/47d6535d4df5cf56cc089cfec40319f0 to your computer and use it in GitHub Desktop.
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 Spacecraft { | |
void describe() { | |
print('hi'); | |
} | |
} | |
class MockSpaceship implements Spacecraft { | |
@override | |
void describe() { | |
print('mock'); | |
} | |
} | |
abstract class Describable { | |
// 抽象メソッド | |
void describe(); | |
void describeWithEmphasis() { | |
print('========='); | |
describe(); | |
print('========='); | |
} | |
} | |
class Describe extends Describable { | |
@override | |
void describe() { | |
print('this class extends Describable class.'); | |
} | |
} | |
void main() { | |
MockSpaceship().describe(); | |
Describe().describeWithEmphasis(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment