//Count to ten??
class BuggyCountToTen {
public static void main (String args[]) {
for (int i=1; i <= 10; i = i - 1) {
System.out.println(i);
}
System.out.println("All done!");
}
}
This program counts backwards. There's nothing fundamentally wrong with a program counting backwards, but the exit condition is that i is bigger than ten. Since i is never going to be bigger than ten in this program, the program never stops.