少年阿賓

          那些青春的歲月

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks

          常用鏈接

          留言簿(22)

          我參與的團隊

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          package com.abin.lee.collection.enumer;
          public class ChangeType {
          public static enum stype{
          CHINA("china"),JAPAN("japan"),GERMAN("german");
          private String textVal;
          private stype(String textVal){
          this.textVal=textVal;
          }
          public String toString(){
          return textVal;
          }
          }
          public static void main(String[] args) {
          String abin=stype.CHINA.toString();
          System.out.println(abin);
          stype abing=stype.valueOf("CHINA");//注意這里不應該傳china、japan、german,必須傳CHINA,JAPAN,GERMAN
          System.out.println("abing="+abing);
          }
          }
          posted on 2012-09-02 15:46 abin 閱讀(413) 評論(0)  編輯  收藏 所屬分類: JavaEnum

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 钟山县| 本溪| 东莞市| 新密市| 隆回县| 新河县| 文水县| 通道| 洪洞县| 兴海县| 绥阳县| 大丰市| 闽清县| 旬邑县| 紫金县| 时尚| 普洱| 蚌埠市| 大渡口区| 六安市| 鸡泽县| 友谊县| 平利县| 天长市| 武穴市| 吴川市| 贵南县| 横山县| 托克逊县| 张北县| 武强县| 宝鸡市| 铜川市| 亚东县| 揭东县| 修水县| 凌源市| 元阳县| 福安市| 怀来县| 隆昌县|