Created
November 19, 2015 06:35
-
-
Save JoeyChor/0d4eab7dff2eb3c10ccd 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
package me.joeychor.test; | |
import java.util.function.Supplier; | |
/** | |
* Created by joeychor on 11/16/2015. | |
*/ | |
public class Main { | |
@FunctionalInterface | |
interface iSaY { | |
Supplier<Runnable> say(); | |
} | |
public static void main(String[] args) { | |
class haveToDoThis implements Runnable { | |
private Object whAttoSAy; | |
haveToDoThis(Object o) { | |
whAttoSAy = o; | |
} | |
public void run() { | |
System.out.println(whAttoSAy); | |
} | |
} | |
class helloWoRLd extends haveToDoThis { | |
helloWoRLd() { | |
super("Hello, world!"); | |
} | |
} | |
iSaY r = () -> helloWoRLd::new; | |
r.say().get().run(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment