Created
September 3, 2012 15:09
-
-
Save Fonsan/3609967 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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package hello; | |
import javax.swing.JFrame; | |
import javax.swing.JLabel; | |
/** | |
* | |
* @author fonsan | |
*/ | |
public class Hello { | |
interface MyInterface { | |
void callback(); | |
} | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { | |
MyInterface callback = new MyInterface() { | |
@Override | |
public void callback() { | |
System.out.println("hej"); | |
} | |
}; | |
function() {} | |
-> | |
doSomethingAsync(callback); | |
} | |
static void doSomethingAsync(MyInterface mi) { | |
mi.callback(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment