Created
March 6, 2021 09:18
-
-
Save jeovazero/f734f4e79ba40c40a248271b679a6bf6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// jeotario's academy | |
class Player { | |
String name; | |
int age; | |
Player(this.name, this.age); | |
} | |
class Org { | |
String name; | |
int majors; | |
Org(this.name, this.majors); | |
@override | |
String toString() { | |
return 'Org { name = $name, majors = $majors }'; | |
} | |
} | |
class ProPlayer extends Player { | |
Org org; | |
ProPlayer(String name, int age, Org _org): | |
org = _org, | |
super(name, age) | |
; | |
} | |
void main() { | |
var org = Org('FooGaming', 1); | |
var p = ProPlayer('ManoloZera', 22, org); | |
print(p.toString()); | |
print(p.name); | |
print(p.age); | |
print(org); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment