package cn.itcast; public class Demo01{ public static void main(String[] args) { //i++:第一:赋值;第二:运算(+1)再赋值; int i = 2; int b = i++; System.out.println("i的值:"+i); System.out.println("b的值:"+b); System.out.println("=================================="); //++i:第一:运算(+1);第二:赋值 int j = 2; int a = ++j; System.out.println("j的值:"+j); System.out.println("a的值:"+a); } } 输出结果: i的值:3 b的值:2 ================================== j的值:3 a的值:3