- class Test7
- {
- public static void main(String[] args)
- {
- int b = 5;
- int a = 6;
- b = a++;
- System.out.println(a+".."+b);
- }
- }
- //这个结果是7..6,我知道a++,这样是先赋值后运算
- class Test8
- {
- public static void main(String[] args)
- {
- int a = 6;
- a = a++;
- int b = a;
- System.out.println(b+"..."+a);
- }
- }
- //为啥这个结果就都是6..6,b为啥也是6,a=a++;a不是++了吗,b不应该是7吗?
复制代码 |
|