我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

self-increment

A problem about sef-increment, the codes in the below:

int i=9;
i=i++;
System.out.println(i);

outcome:9

Could you please tell me the reason why the outcome is 9 not 10; thanks

i=i++;

先把i放到一个临时变量,再自增,再把临时变量赋值给i。

http://www.chinaunix.net/jh/26/429688.html

因为临时变量的关系

近期文章

  • linux下tomcat运行几个小时,就挂掉,2~3天就会把服务器拖死的问题
  • 我用jQuery写的一个级联菜单的例子,可是居然用ie测试失败
  • JSP操作mysql的SQL语句
  • Ajax跨域访问
  • 如何带新人?
  • 请教Ehcache结合spring ,hibernate的问题
  • jsp调用servlet问题
  • 客户端用axis调用xfire服务器端webservice出错。。
  • 关于 jquery 和 freemarker
  • 第一份工作,两份offer,请问我该如何决策?谢谢。
  • 在Ext.Viewport中的可以拖动的面板 怎样获的其拖动后的位置;记录在数据库;
  • 大家是如何学习J2EE的
  • flex中用HTTPService 显示xml数据
  • junit4
  • 每周自动获取“单选题"作答如何设计啊?
  • 关于php中引号的问题
  • 请问如何动态地设置一个element的属性(如width、height、title等)
  • hibernate 延迟加载的错误 failed to lazily initialize a collection of role no session o
  • matlab与abaqus的联合仿真?
  • XML解析错误:未找到元素

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华