Created
September 26, 2011 04:17
-
-
Save todesking/1241605 to your computer and use it in GitHub Desktop.
wtf
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 enum A { | |
Hoge(CONST); // Cannot reference a field before it is defined | |
private static int CONST = 1; | |
private A(int x) { | |
} | |
} | |
public enum B { // Syntax error on token "{", ; expected after this token | |
private static int CONST = 1; | |
Hoge(CONST); | |
private B(int x) { | |
} | |
} | |
public enum C { // OK | |
Hoge(Proxy.CONST); | |
private static class Proxy { | |
public static int CONST = 1; | |
} | |
private C(int x) { | |
} | |
} | |
public enum D { // OK | |
Hoge(getConst()); | |
private static int getConst() { | |
return 1; | |
} | |
D(int x) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment