zoukankan      html  css  js  c++  java
  • Enum

    public enum GenderEnum {
        MAN("1","男"),
        WOMAN("2","女");
    
        GenderEnum(String code,String codeName){
            this.code = code;
            this.codeName = codeName;
        }
    
        public static String getGenderNameByCode(String code){
            String codeName;
            switch (code){
                case "1":
                    codeName = GenderEnum.MAN.codeName;
                    break;
                case "2":
                    codeName = GenderEnum.WOMAN.codeName;
                    break;
                    default:
                        codeName = "未知";
            }
            return codeName;
        }
    
        private String code;
        private String codeName;
    
        public String getCode() {
            return code;
        }
    
        public void setCode(String code) {
            this.code = code;
        }
    
        public String getCodeName() {
            return codeName;
        }
    
        public void setCodeName(String codeName) {
            this.codeName = codeName;
        }
    }
  • 相关阅读:
    hdu 2222 Keywords Search
    Meet and Greet
    hdu 4673
    hdu 4768
    hdu 4747 Mex
    uva 1513 Movie collection
    uva 12299 RMQ with Shifts
    uva 11732 strcmp() Anyone?
    uva 1401
    hdu 1251 统计难题
  • 原文地址:https://www.cnblogs.com/lijianda/p/12621281.html
Copyright © 2011-2022 走看看