自增 加减运算

 1 package test;
 2 //i++ 先取值后运算     int i=4; int j=i++;   i=5;j=4;  
 3 //++i  先运算后取值   int i=4;int j=++i;   i=5;j=5;
 4 public class Test6 {
 5 public static void main(String []args){
 6     System.out.println("测试开始");
 7     int a=5;
 8     int b=4;
 9     System.out.println(b+=a++);   //b=9  a=6
10     System.out.println(b+=++a);   // 16   a=7
11     System.out.println(b-=a--);  //  9   6
12     System.out.println(b-=--a); // 4  5
13     }
14 }

念起,便是这个季节最浓的色彩
原文地址:https://www.cnblogs.com/ck19950629/p/5902538.html