-
-
Save zapl/443ca6272d41db24a992c1c536d7ed45 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 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)); | |
} | |
} |
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
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