Get your
own
website
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
abstract class Employee { String name; Employee(this.name); double salary(); void printPay() { print('$name earns \$${salary()} per month'); } } class Manager extends Employee { Manager(super.name); @override double salary() => 5000; } class Intern extends Employee { Intern(super.name); @override double salary() => 1200; } void main() { Manager('Sara').printPay(); Intern('Ben').printPay(); }
Sara earns $5000.0 per month
Ben earns $1200.0 per month