java2從頭開學(8)

          package 數據類型;
          //強制類型轉換
          class Conversion {
          ?public static void main(String args[]){
          ??byte b;
          ??int i = 257;
          ??double d = 323.142;
          ??
          ??System.out.println("\nConversion of int to byte.");
          ??b = (byte) i;
          ??System.out.println("i and b " + i + " " + b);
          ??
          ??System.out.println("\nConversion of double to byte.");
          ??i = (int) d;
          ??System.out.println("d and i " + d + " " + i);
          ??
          ??System.out.println("\nConversion of double to byte.");
          ??b = (byte) d;
          ??System.out.println("d and b " + d + " " + b);
          ?}

          }

          posted on 2008-04-11 14:33 dripstone 閱讀(183) 評論(0)  編輯  收藏


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


          網站導航:
           
          <2008年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆分類(1)

          隨筆檔案(16)

          友情鏈接

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 南昌市| 建宁县| 盈江县| 霍州市| 孝昌县| 佛冈县| 响水县| 张家口市| 长顺县| 渝中区| 四会市| 靖边县| 建瓯市| 昌都县| 安泽县| 舒兰市| 汤原县| 南召县| 天水市| 库车县| 汪清县| 吕梁市| 博湖县| 亚东县| 渝北区| 永康市| 怀集县| 西丰县| 岳普湖县| 蒲江县| 宜春市| 湖北省| 许昌县| 缙云县| 广南县| 沧州市| 新津县| 元谋县| 贡山| 安义县| 临朐县|