Created
May 12, 2022 18:42
-
-
Save kingwill101/3a388203f3b01858cb34726b3a3a6f50 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 Fruit { | |
final String someString; | |
Fruit(this.someString); | |
void printString() { | |
print(someString); | |
} | |
} | |
String modString(String someString) { | |
return "$someString + extra"; | |
} | |
class Apple extends Fruit { | |
Apple(String someString) : super(modString(someString)); | |
} | |
void main() { | |
var apple = Apple("This is an apple"); | |
apple.printString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment