Object Oriented Software Engineering   View all facts   Glossary   Help
subject > programming language construct > statement > loop > for loop
Next loopwhile loop    Uploop

for loop
subjectfact 
for loopcan be interchanged with a while looplink: chapter2section2.8.html#751, 2001-08-30 14:55:37.0
has advantage all the information about controlling the loop is kept in one placelink: chapter2section2.8.html#753, 2001-08-30 14:55:37.0
has disadvantage it can be slightly harder to read the code of a for loop than a while looplink: chapter2section2.8.html#753, 2001-08-30 14:55:37.0
has form
for(initializer; condition; incrementer)
{
// statements to keep executing while condition is true
}
link: chapter2section2.8.html#746, 2001-08-30 14:55:38.0
has part incrementerlink: chapter2section2.8.html#747, 2001-08-30 14:55:38.0
has part initializerlink: chapter2section2.8.html#747, 2001-08-30 14:55:38.0
is a subtopic of The Basics of Java2001-08-30 14:55:38.0
is a kind of loop2001-08-30 14:55:38.0
loophas identical syntax in Java, C and C++2001-08-30 14:56:31.0
statementshould be not more than one line long if possible2001-08-30 14:57:47.0