Skip to content

Instantly share code, notes, and snippets.

@xTachyon
Created December 17, 2017 12:15
Show Gist options
  • Save xTachyon/05e88f642bf8e884a4f3a2a3a03f1e17 to your computer and use it in GitHub Desktop.
Save xTachyon/05e88f642bf8e884a4f3a2a3a03f1e17 to your computer and use it in GitHub Desktop.
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