Skip to content

Instantly share code, notes, and snippets.

@zapl

zapl/Api.java Secret

Created September 25, 2018 14:28
Show Gist options
  • Save zapl/443ca6272d41db24a992c1c536d7ed45 to your computer and use it in GitHub Desktop.
Save zapl/443ca6272d41db24a992c1c536d7ed45 to your computer and use it in GitHub Desktop.
public interface Api {
public interface Listener {
void onEvent(String name);
}
void listen(Listener listener);
}
class JUser {
void test() {
new Impl().listen(name -> System.out.println(name));
}
}
class Impl : Api {
override fun listen(listener: Api.Listener?) {
// something
}
}
class UserK {
fun test() {
Impl().listen { println(it) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment