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
void main() { | |
Car nissan = Car(); | |
ElectricCar opel = ElectricCar(); | |
FlyingCar vw = FlyingCar(); | |
print(nissan.numberOfSeats); | |
nissan.drive(); | |
print(opel.numberOfSeats); | |
opel.drive(); | |
vw.drive(); | |
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
void main() { | |
Human mark = Human(186); | |
Human elon = Human(169); | |
print(mark.height); | |
print(elon.height); | |
} | |
class Human { | |
int height; | |
Human(int height) { |