posts - 495,  comments - 11,  trackbacks - 0
          string->byte
          Byte static byte parseByte(String s)

          byte->string
          Byte static String toString(byte b)

          char->string
          Character static String to String (char c)

          string->Short
          Short static Short parseShort(String s)

          Short->String
          Short static String toString(Short s)

          String->Integer
          Integer static int parseInt(String s)

          Integer->String
          Integer static String tostring(int i)

          String->Long
          Long static long parseLong(String s)

          Long->String
          Long static String toString(Long i)

          String->Float
          Float static float parseFloat(String s)

          Float->String
          Float static String toString(float f)

          String->Double
          Double static double parseDouble(String s)

          Double->String
          Double static String toString(Double

          1如何將字串 String 轉換成整數 int?

          A. 有兩個方法:

          1). int i = Integer.parseInt([String]); 或
          i = Integer.parseInt([String],[int radix]);

          2). int i = Integer.valueOf(my_str).intValue();

          注: 字串轉成 Double, Float, Long 的方法大同小異.


          2 如何將整數 int 轉換成字串 String ?


          A. 有叁種方法:

          1.) String s = String.valueOf(i);

          2.) String s = Integer.toString(i);

          3.) String s = "" + i;

          注: Double, Float, Long 轉成字串的方法大同小異.
          ???? 輸入洋點型數
          ???? 輸入浮點數和雙精度數的處理方法和處理整數的方法幾乎一樣,但轉換的過程更復雜。???? F而的
          艾碼可以讀入一個雙精度型數;
          String s="1212";
          Double adbu=Double.valueOf(s);
          return adbu.doubleValue();

          posted on 2007-04-29 19:16 jadmin 閱讀(61) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 宽甸| 宾阳县| 合作市| 旬阳县| 乃东县| 扶沟县| 故城县| 吉安市| 桦川县| 荥经县| 康乐县| 永平县| 大埔区| 玉田县| 武平县| 宣恩县| 临桂县| 西峡县| 南城县| 绥中县| 全椒县| 屏东县| 独山县| 黄山市| 西和县| 太康县| 西贡区| 叙永县| 闵行区| 青龙| 延津县| 定州市| 句容市| 柳林县| 柘荣县| 大渡口区| 普兰店市| 安仁县| 奉节县| 百色市| 麻江县|