Skip to content

Instantly share code, notes, and snippets.

@fvisticot
Created October 3, 2019 21:59
Show Gist options
  • Save fvisticot/225dac85e1cda1c07b6c57f9dc9b5e1c to your computer and use it in GitHub Desktop.
Save fvisticot/225dac85e1cda1c07b6c57f9dc9b5e1c to your computer and use it in GitHub Desktop.
Abstract class
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