java2從頭開學(12)

          package 數據類型;
          //類型提升約定
          class Promote {
          ?public static void main(String args[]){
          ??byte b = 42;
          ??char c = 'a';
          ??short s = 1024;
          ??int i = 50000;
          ??float f = 5.67f;
          ??double d = .1234;
          ??double result = (f * b) + (i / c) - (d * s);
          ??System.out.println((f * b) + " + " + (i / c) + " - " + (d * s));
          ??System.out.println("result = " + result);
          ?}
          }

          posted on 2008-04-11 14:35 dripstone 閱讀(219) 評論(0)  編輯  收藏 所屬分類: java2學習


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


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

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆分類(1)

          隨筆檔案(16)

          友情鏈接

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 平原县| 根河市| 浑源县| 桐梓县| 和静县| 淳化县| 洞头县| 晋州市| 大竹县| 饶阳县| 鱼台县| 繁昌县| 南丹县| 铜鼓县| 内乡县| 天门市| 若尔盖县| 焉耆| 万全县| 鹰潭市| 三门县| 涡阳县| 新乡县| 喀喇| 石棉县| 临朐县| 禄劝| 乌拉特前旗| 古田县| 德清县| 江都市| 鲁甸县| 分宜县| 夏津县| 类乌齐县| 滨州市| 富宁县| 昭苏县| 崇明县| 咸阳市| 泾源县|