<P> In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition . The while loop can be thought of as a repeating if statement . </P> <P> The while construct consists of a block of code and a condition / expression . The condition / expression is evaluated, and if the condition / expression is true, the code within the block is executed . This repeats until the condition / expression becomes false . Because the while loop checks the condition / expression before the block is executed, the control structure is often also known as a pre-test loop . Compare this with the do while loop, which tests the condition / expression after the loop has executed . </P> <P> For example, in the C programming language (as well as Java, C#, Objective - C, and C++, which use the same syntax in this case), the code fragment </P> <P> first checks whether x is less than 5, which it is, so then the (loop body) is entered, where the printf function is run and x is incremented by 1 . After completing all the statements in the loop body, the condition, (x <5), is checked again, and the loop is executed again, this process repeating until the variable x has the value 5 . </P>

When is the controlling condition of a java while loop checked to see if it is true or false