一个关于自增的小小问题。。。
java吧
全部回复
仅看楼主
level 5
gengyanqikobe 楼主
public class Dome
{
public static void main(String[] args)
{
int a=3;
int b=4;
int c,d;
c=a++;d=(++a)+(b--);
System.out.println(c+" "+d);
System.out.println(a+" "+b);
} }
2012年04月24日 03点04分 1
level 5
gengyanqikobe 楼主
2012年04月24日 03点04分 2
level 5
gengyanqikobe 楼主
为什么3加5就得9了呢
2012年04月24日 03点04分 3
level 5
表示++在前面是语句还没执行先自增 ++在后面是执行完在自增。可以加群230791994一起讨论。。
2012年04月24日 03点04分 4
level 5
gengyanqikobe 楼主
明白了- -
2012年04月24日 04点04分 5
1