Created
March 20, 2018 04:52
-
-
Save vadimtsushko/1105a830606b0ab4f5c255714e989be6 to your computer and use it in GitHub Desktop.
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
abstract class Foo { | |
Function execute; | |
} | |
class Bar1 implements Foo { | |
Function execute = (String s) => print('Bar1 execute s: $s'); | |
} | |
class Bar2 implements Foo { | |
Function execute = (int i) => print('Bar2 execute i: $i, i*2: ${i*2}'); | |
} | |
void main() { | |
var bar1 = new Bar1(); | |
bar1.execute('Hello'); | |
bar1.execute(200); | |
var bar2 = new Bar2(); | |
bar2.execute(4); | |
bar2.execute('Hello'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment