cycle-sort

java: while loop - statement with a semicolon before going into statements between curly braces?

荒凉一梦 提交于 2020-01-25 10:07:44
问题 I was looking at another page here on stackoverflow and came across a working implementation of cycle sort, but I don't understand how a statement with a semicolon can exist before the curly braces in a while loop. I thought that the while loop is supposed to completely terminate and take no further actions once it finds a statement with a semicolon, so how is it that the code within the curly braces is getting executed? At first glance, I would interpret this as "var" gets incremented with

java: while loop - statement with a semicolon before going into statements between curly braces?

≯℡__Kan透↙ 提交于 2020-01-25 10:07:28
问题 I was looking at another page here on stackoverflow and came across a working implementation of cycle sort, but I don't understand how a statement with a semicolon can exist before the curly braces in a while loop. I thought that the while loop is supposed to completely terminate and take no further actions once it finds a statement with a semicolon, so how is it that the code within the curly braces is getting executed? At first glance, I would interpret this as "var" gets incremented with