數(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 郭興華 閱讀(123) 評論(0)  編輯  收藏


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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 莲花县| 布尔津县| 安龙县| 孟津县| 盘山县| 张北县| 洛南县| 浦城县| 临城县| 广汉市| 桦川县| 临沧市| 张掖市| 郓城县| 双峰县| 亚东县| 陆河县| 仁怀市| 清涧县| 祁连县| 如皋市| 绥棱县| 广西| 营山县| 永春县| 根河市| 金平| 白河县| 张家港市| 陕西省| 永泰县| 布尔津县| 临朐县| 故城县| 微山县| 贡觉县| 奇台县| 汪清县| 哈尔滨市| 汨罗市| 毕节市|