Last active
October 4, 2015 16:36
-
-
Save yardfarmer/a2a0758646c4ea16ddbf to your computer and use it in GitHub Desktop.
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
public class Lalala { | |
public static void main(String[] args) { | |
new Runnable() { | |
public void run() { | |
System.out.println("runnable."); | |
} | |
}.run(); | |
// 好想 js 命名函数 | |
int i = 0; | |
Runnable r =()->{ | |
System.out.println("lambada"); | |
// i =2; // 在闭包作用域中的本地变量,不能被修改 | |
}; | |
r.run(); | |
r.run(); | |
Action login = (String content)->{ | |
System.out.println(content); | |
}; | |
login.execute("abcd"); | |
} | |
} | |
interface Action { | |
void execute(String s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lamada 的用法