while loop java stack overflow code example Example: for loop in java stack overflow for(counter=10;counter>=1;counter--){ System.out.println(counter); }