Skip to content

Instantly share code, notes, and snippets.

@dicenull
Created March 14, 2024 08:16
Show Gist options
  • Save dicenull/47d6535d4df5cf56cc089cfec40319f0 to your computer and use it in GitHub Desktop.
Save dicenull/47d6535d4df5cf56cc089cfec40319f0 to your computer and use it in GitHub Desktop.
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