Skip to content

Instantly share code, notes, and snippets.

@hagun
Last active February 2, 2017 08:09
Show Gist options
  • Select an option

  • Save hagun/0c5876806151e6d71ba1e3d6fdebf9c0 to your computer and use it in GitHub Desktop.

Select an option

Save hagun/0c5876806151e6d71ba1e3d6fdebf9c0 to your computer and use it in GitHub Desktop.
anonymous class
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