posts - 73,  comments - 55,  trackbacks - 0

          數字類型轉換成字符串型:
          String s = String.valueOf(value);?

          數字對象轉換成字符串型
          Long l = new Long(10);
          String s = l.toString();

          數字類型/字符串轉換成數字對象:
          byte b = 169;
          String b = "169";
          Byte bo = new Byte( b );

          short t = 169;
          String b = "169";
          Short to = new Short( t );

          int i = 169;
          String b = "169";
          Integer io = new Integer( i );

          long l = 169;
          String b = "169";
          Long lo = new Long( l );

          float f = 169f;
          String b = "169";
          Float fo = new Float( f );

          double d = 169f;
          String b = "169";
          Double dObj = new Double( d );?

          字符串型轉換成各種數字類型:
          String s = "169";
          byte b = Byte.parseByte( s );
          short t = Short.parseShort( s );
          int i = Integer.parseInt( s );
          long l = Long.parseLong( s );
          float f = Float.parseFloat( s );
          double d = Double.parseDouble( s );

          數字對象轉換成數字類型:(*o為一數字對象)
          b = bo.byteValue();
          t = to.shortValue();
          i = io.intValue();
          l = lo.longValue();
          f = fo.floatValue();
          d = dObj.doubleValue();

          posted on 2006-06-01 14:37 保爾任 閱讀(327) 評論(0)  編輯  收藏

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


          網站導航:
           

          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿(4)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 龙泉市| 页游| 繁峙县| 西藏| 怀化市| 伊宁县| 建昌县| 卓资县| 金寨县| 房山区| 腾冲县| 巫溪县| 即墨市| 枞阳县| 旬阳县| 霍邱县| 清苑县| 瓮安县| 上虞市| 越西县| 论坛| 武宁县| 龙里县| 宣武区| 抚远县| 得荣县| 阿合奇县| 逊克县| 岑溪市| 涪陵区| 灵武市| 大兴区| 寿阳县| 沭阳县| 清苑县| 岫岩| 冷水江市| 宝丰县| 武清区| 盈江县| 西峡县|