Created
December 17, 2017 12:15
-
-
Save xTachyon/05e88f642bf8e884a4f3a2a3a03f1e17 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 Main { | |
@FunctionalInterface | |
interface MagicalInterface<T> { | |
void doSomething(T x); | |
} | |
static class Something {} | |
static void vroomVroom(Something x) { | |
System.out.println(x.toString()); | |
} | |
public static void main(String[] args) { | |
MagicalInterface var = (MagicalInterface<Something>) Main::vroomVroom; | |
Object s = new Something(); | |
var.doSomething(s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment