Skip to content

Instantly share code, notes, and snippets.

@JoeyChor
Created November 19, 2015 06:35
Show Gist options
  • Save JoeyChor/0d4eab7dff2eb3c10ccd to your computer and use it in GitHub Desktop.
Save JoeyChor/0d4eab7dff2eb3c10ccd to your computer and use it in GitHub Desktop.
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