隨筆-9  評論-168  文章-266  trackbacks-0

           如何將字串 String 轉(zhuǎn)換成整數(shù) int?
          int i = Integer.valueOf(my_str).intValue();

          int i=Integer.parseInt(str);

          如何將字串 String 轉(zhuǎn)換成Integer ?
          Integer integer=Integer.valueOf(str);

          如何將整數(shù) int 轉(zhuǎn)換成字串 String ?
          1.) String s = String.valueOf(i);
           
          2.) String s = Integer.toString(i);
           
          3.) String s = "" + i;

          如何將整數(shù) int 轉(zhuǎn)換成Integer ?
          Integer integer=new Integer(i);

          如何將Integer 轉(zhuǎn)換成字串 String ?
          Integer integer=String

          如何將Integer 轉(zhuǎn)換成 int ?
          int num=Integer.intValue();

          如何將String轉(zhuǎn)換成  BigDecimal  ?
           BigDecimal d_id = new BigDecimal(str);


          如何將 String 轉(zhuǎn)換成 char ?
          char[] ca="123".toCharArray();

          如何將char轉(zhuǎn)換成String?
          String s=ca.toString();      //任何類型都可以采用toString()轉(zhuǎn)換成String類型

          //-----------------日期-------------------------

          Calendar calendar=Calendar.getInstance();
            int year=calendar.get(Calendar.YEAR);
            int month=calendar.get(Calendar.MONTH)+1;
            int day=calendar.get(Calendar.DATE);

          獲取今天的日期字符串
          String today=java.text.DateFormat.getDateInstance().format(new java.util.Date());
          獲取今天的日期
          new java.sql.Date(System.currentTimeMillis())

          posted on 2008-09-09 14:18 紫蝶∏飛揚(yáng)↗ 閱讀(4422) 評論(1)  編輯  收藏 所屬分類: JSFSpringStruts1/2Hibernate重點(diǎn)數(shù)據(jù)轉(zhuǎn)換

          評論:
          # Internet Marketing 2009-05-18 12:51 | Internet Marketing
          Hi all. The great art of giving consists in this: the gift should cost very little and yet be greatly coveted, so that it may be the more highly appreciated.
          I am from Portugal and also now'm speaking English, give true I wrote the following sentence: "Com tips on how to do keyword research for search engine optimization to help ensure your site ranks well in search engines like google.Alexa rank and page rank provided by alexa."

          With love 8-), Red.  回復(fù)  更多評論
            
          主站蜘蛛池模板: 伽师县| 道孚县| 连江县| 会同县| 余干县| 安新县| 揭西县| 桦川县| 崇仁县| 察隅县| 阜新| 大石桥市| 灵山县| 万山特区| 旬阳县| 南充市| 武冈市| 扬州市| 蒙城县| 庆元县| 张家口市| 酒泉市| 施秉县| 武威市| 平昌县| 山阴县| 阿坝| 兴义市| 舟山市| 临夏市| 安乡县| 保亭| 衡阳县| 德江县| 本溪市| 集安市| 仁化县| 申扎县| 台江县| 合山市| 洞口县|