Java   View all facts   Glossary   Help
syntactic unit > statement > control flow statement > loop statement > while loop
Next loop statementdo-while loop    Uploop statement    Previous loop statementfor loop   

while loop
subjectfact 
while loopcan be interchanged with a for loop    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:38:17.0
has example
//Decrement n by 1 until n is 0
while (n != 0) {
n = n - 1;
}
added by: JK, source: Sun Java Tutorial, 2001-10-19 11:38:17.0
has purpose to repeat a computation by looping through that computation until a test has been satisfiedadded by: JK, source: On To Java, 2001-10-19 11:38:17.0
has syntax
while(condition)
{
// statements to keep executing while condition is true
}   
source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:38:17.0
is a subtopic of Loops and Decision Making2001-10-19 11:38:17.0
is a kind of loop statementsource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:38:17.0
statementis terminated by a semicolon    2001-10-19 11:37:57.0
should be not more than one line long if possible2001-10-19 11:37:57.0
syntactic unithas syntax rule
bold = mandatory
italic = non-terminal
normal font = optional
2001-10-19 11:38:04.0