int count = 10; count += ++count; System.out.println(count); 能否通过编译?打印输出是多少?
原问题:int count = 10; count += ++count; System.out.println(count); 能否通过编译?打印输出是多少?
分类:编程开发 > 最后更新时间:【2016-12-17 02:48:37】
分类:编程开发 > 最后更新时间:【2016-12-17 02:48:37】
最佳答案
能够通过编译,结果为21
你的表达式等价于
count = count + ++count;
=10+11(后面的是先++,但运算时放入临时变量的,所以前面的count不是11)
最佳答案由网友 whoami1978 提供
其他回答
暂无其它回答!