Java递增递减运算符的前后特性

2019年2月12日20:18:18 发表评论 926 views
/**
 * Created by xabcd on 2019/2/12.
 */
public class TestJava3_18
{public static void main(String args[])
{
    int a = 3,b = 3;
    System.out.println("a = " +a);
    System.out.println(",a++" + (a++));
    System.out.println(a);
    System.out.print("b="+b);
    System.out.println("++b="+(++b)+",b="+b);
}
}







结果:
a = 3
,a++3
4
b=3++b=4,b=4

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: