Skip to content

Instantly share code, notes, and snippets.

View Zenderable's full-sized avatar
🎯
Focusing

Karol Stumski Zenderable

🎯
Focusing
View GitHub Profile
@Zenderable
Zenderable / main.dart
Last active May 31, 2019 14:59
Example of inheritance and polymorphism in Dart
void main() {
Car nissan = Car();
ElectricCar opel = ElectricCar();
FlyingCar vw = FlyingCar();
print(nissan.numberOfSeats);
nissan.drive();
print(opel.numberOfSeats);
opel.drive();
vw.drive();
@Zenderable
Zenderable / main.dart
Created May 30, 2019 20:01
Example of constructor in Dart
void main() {
Human mark = Human(186);
Human elon = Human(169);
print(mark.height);
print(elon.height);
}
class Human {
int height;
Human(int height) {