數(shù)據(jù)加載中……
          測試自增、自減操作

          /*
          *測試自增、自減操作
          */
          public class SelfAction
          {
           public static void main(String[] args)
           {
            int x = 10;
            int a = x + x++;
            System.out.println("a=" + a);
            System.out.println("x=" + x);
            int b = x + ++x;
            System.out.println("b=" + b);
            System.out.println("x=" + x);
            int c = x + x--;
            System.out.println("c=" + c);
            System.out.println("x=" + x);
            int d = x + --x;
            System.out.println("d=" + d);
            System.out.println("x=" + x); 


           }
          }
          輸出 是
          a=20
          x=11
          b=23
          x=12
          c=24
          x=11
          d=21
          x=10

          posted on 2008-10-13 07:06 郭興華 閱讀(122) 評論(0)  編輯  收藏


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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 随州市| 阿鲁科尔沁旗| 灵寿县| 金堂县| 丹寨县| 榆林市| 桂平市| 桑日县| 军事| 吉水县| 海兴县| 安图县| 南昌县| 浑源县| 抚远县| 化州市| 寿阳县| 瑞丽市| 马公市| 高邑县| 道孚县| 伊通| 霍邱县| 芜湖市| 镇原县| 广汉市| 临洮县| 南康市| 巩留县| 林周县| 延庆县| 佛冈县| 景谷| 萍乡市| 岳池县| 旅游| 哈尔滨市| 廉江市| 咸阳市| 定日县| 曲靖市|