Java non-static inner class 内部不能声明 Enum

来源:互联网 发布:vpn用数据还是wifi 编辑:程序博客网 时间:2024/06/09 19:56

enum types that are defined as nested types are always implicitlystatic (see JLS §8.9. Enums)

You can't have a static nested type inside a non-static one (a.k.a an "inner class", seeJLS §8.1.3. Inner Classes and Enclosing Instances).

Therefore you can't have an enum inner type inside a non-static nested type.


0 0
原创粉丝点击