组合String以构造枚举值

时间:2013-04-12 04:14:50

标签: java enums

只是想知道这是否是构建枚举值的好习惯。

public enum SomeConstant{


     ENUM_ONE("this is my "),
     ENUM_TWO(ENUM_ONE.getSomeConstant() + " enum");

     private final String constant;

     private SomeConstant(String constant){
         this.constant = constant;
     }

     private String getSomeConstant(){
         return constant;
     }


}

0 个答案:

没有答案