Created
May 6, 2015 14:04
-
-
Save RobertFischer/bbf84b9e8986becd8940 to your computer and use it in GitHub Desktop.
Demonstration of Anonymous Extension in Java
This file contains hidden or 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 AnonymousExtend { | |
public static class Doer { | |
public void doIt() { | |
System.out.println("Hello, World!"); | |
} | |
} | |
public static final Doer MY_DOER = new Doer() { | |
@Override | |
public void doIt() { | |
System.out.println("OVERRIDE!"); | |
} | |
}; | |
public static void main(String[] argv) { | |
MY_DOER.doIt(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment