+ 1
When are increments best used?
2 Respuestas
+ 2
You can use increment operation while using the variable for other calculations. Then you would practically merge 2 statements into 1.
Sometimes it makes the code more readable, sometimes it doesn't.
0
To increase numbers.
int num = 0;
for(int i = 0; i < 5; i++) { // Increment
num++; // Increment
}
System.out.println(num);
// 5