while(count <= maxNum){
System.out.println("O-------O");
System.out.printf("|" + "%8s", count + "|");
System.out.println("O-------O");
count++;
startTime = System.currentTimeMillis();
//an empty loop! does nothing except keeps checking the continuation condition
//continues as long as the time that has passed is less than millisToWait
while(System.currentTimeMillis() - startTime < millisToWait);
System.out.println("O-------O");
Above is the part of code that conecerns the actual output of what I am trying to achieve. The code, for the most part works as intended, except the output(below is the output attached as an image) is not 100% correct. There is an extra "O-------O" to the right of every number.
Correct me if I'm wrong, but I believe it has something to do with the first println statement, but I'm still not sure how it's printing once on top and then once to the side. Any help is appreciated.