Last active
February 2, 2017 08:09
-
-
Save hagun/0c5876806151e6d71ba1e3d6fdebf9c0 to your computer and use it in GitHub Desktop.
anonymous class
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 MeaningOfThis { | |
| public final int value = 4; | |
| public void doIt() { | |
| int value = 6; | |
| Runnable r = new Runnable() { | |
| public final int value = 5; | |
| public void run() { | |
| int value = 10; | |
| System.out.println(this.value); | |
| } | |
| }; | |
| r.run(); | |
| } | |
| public static void main(String... args) { | |
| MeaningOfThis m = new MeaningOfThis(); | |
| m.doIt(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment