📜  增量java代码示例

📅  最后修改于: 2022-03-11 14:52:25.598000             🧑  作者: Mango

代码示例2
// you can use two types of increments
int x = 0;
//Postincrement
System.out.println(x++); //this prints 0 because increments after execute print
//Pretincrement      // x = 1 and + 1 again is equal to 2 in the second print
System.out.println(++x); // this prints 2 because increments before execute print