Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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) {
- }
- }
Add Comment
Please, Sign In to add comment