Skip to content

Instantly share code, notes, and snippets.

@zoren
Created December 26, 2022 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoren/ae8f1f91df51fabaef077521d6bbe235 to your computer and use it in GitHub Desktop.
Save zoren/ae8f1f91df51fabaef077521d6bbe235 to your computer and use it in GitHub Desktop.
class Outer {
static final int staticFinalConstant = 42;
class Inner {
public int field = staticFinalConstant;
}
static void m() {
new Inner(); // error: non-static variable this cannot be referenced from a static context
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment