Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于自增 #2

Open
zhaoyangyinmu opened this issue Sep 20, 2016 · 1 comment
Open

关于自增 #2

zhaoyangyinmu opened this issue Sep 20, 2016 · 1 comment

Comments

@zhaoyangyinmu
Copy link

zhaoyangyinmu commented Sep 20, 2016

如果 i = i++; 等价于:

i = i;
i++;

为什么在 atom 上运行时,

i = 1;
System.out.println(i);
i = i++;
System.out.println(i);

出现的结果为:

1
1
@wenuanhappy
Copy link

第一句话就有问题哦,不等价~;i++在赋值之前就完成了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants