关闭

OCP 关于enum的坑

75人阅读 评论(0) 收藏 举报

1. Enum type can't be extended.

2. Enum's constants must be declared on the first line of the enum type declaration.

3, if there are more than constant declaration, the constant declaration must be ended with semi-colon; 

3. Enum type's constructor must not be declared as public and protected

4. Enum type can have public instance variable

0
1

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:167次
    • 积分:29
    • 等级:
    • 排名:千里之外
    • 原创:2篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档