自增

小程序示例

 public static void main(String[] args) throws Throwable {
        int num = 50 ;
        num = num ++ * 2 ;
        System.out.println(num) ;
    }

由于先进行赋值操作,再进行++。赋值后num还是50,然后进行乘法操作,所以最终的运行结果是100;

 

posted @ 2020-07-17 20:42  沉默小和尚  阅读(233)  评论(0编辑  收藏  举报