Created
October 3, 2019 21:59
-
-
Save fvisticot/225dac85e1cda1c07b6c57f9dc9b5e1c to your computer and use it in GitHub Desktop.
Abstract class
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
void main() { | |
Car car1 = Car("Car1"); | |
car1.go(); | |
car1.sayHello(); | |
} | |
abstract class Vehicule { | |
final String name; | |
Vehicule(this.name); | |
void sayHello() { | |
print("Hello from Vehicule"); | |
} | |
void go() { | |
print("Go from Vehicule"); | |
} | |
} | |
class Car extends Vehicule { | |
Car(String name): super(name); | |
@override | |
void sayHello() { | |
print("Hello from Car"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment