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 保爾任 閱讀(329) 評論(0)  編輯  收藏

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


          網站導航:
           

          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(4)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 周至县| 库车县| 乃东县| 蓬莱市| 平和县| 太湖县| 区。| 胶南市| 昌吉市| 铜鼓县| 惠来县| 嘉黎县| 青海省| 大同县| 房产| 哈尔滨市| 蒲江县| 偃师市| 郴州市| 玉山县| 巴彦县| 长岭县| 故城县| 左贡县| 陆河县| 新邵县| 彭泽县| 手游| 夹江县| 德惠市| 古蔺县| 梅河口市| 都江堰市| 定陶县| 西和县| 宁晋县| 南溪县| 遵义县| 独山县| 曲麻莱县| 海淀区|