Object Oriented Software Engineering   View all facts   Glossary   Help
subject > programming language construct > statement > loop
Next statement: OCL statement    Up: statement    Previous statement: long statement   

loop comparison table
Subject have disadvantage has part interchange with have advantage have form
for loopit can be slightly harder to read the code of a for loop than a while loopinitializera while loopall the information about controlling the loop is kept in one place
for(initializer; condition; incrementer)
{
// statements to keep executing while condition is true
}
while loop conditiona for loop 
while(condition)
{
// statements to keep executing while condition is true
}

Next statement: OCL statement    Up: statement    Previous statement: long statement