java中i++和++i的区别

2025-01-01 12:44:17
推荐回答(1个)
回答1:

i++是先取值,后加加,++i是先加加后取值!
int i = 0;
System.out.println(i++);
int j = 0;
System.out.println(++j);
打印0,1