Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- private interface Delegate { void execute(String str); }
- private static void delegateCaller(Delegate delegate) {
- delegate.execute("Hello world");
- }
- public static void main(String[] args) {
- delegateCaller(new Delegate() {
- @Override
- public void execute(String str) {
- System.out.println(str);
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement