public class counting { private static int counter = 0; public void boolean counterCheck(){ counter++; if(counter==10) counter=0; } }
Biggest danger? Two increments to counter before the counter == 10 check, making the reset to 0 never happen.
counter
counter == 10
0