Created
May 18, 2010 19:08
-
-
Save Sitwon/405387 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 Lambda { | |
abstract public void func(); | |
} | |
public class Example { | |
public static void main(String args[]) { | |
System.out.println("Begin main"); | |
final String hello = "Hello World!"; | |
functionCall(new Lambda() { | |
public void func() { | |
System.out.println("First lambda"); | |
} | |
}); | |
functionCall(new Lambda() { | |
public void func() { | |
System.out.println("Main's 'hello': " + hello); | |
} | |
}); | |
System.out.println("End main"); | |
} | |
static void functionCall(Lambda l) { | |
System.out.println("function start"); | |
l.func(); | |
System.out.println("function end"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment