Non-object-oriented language basics, Part 3; Learn statements and construct interesting programs

The while loop statement evaluates a Boolean expression and, if this expression is true, executes another statement. After that other statement executes, the while loop statement reevaluates the Boolean expression. If it is still true, the other statement reexecutes. That cycle repeats until the Boo...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Java world 2001-02, p.1
1. Verfasser: Friesen, Geoff
Format: Magazinearticle
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The while loop statement evaluates a Boolean expression and, if this expression is true, executes another statement. After that other statement executes, the while loop statement reevaluates the Boolean expression. If it is still true, the other statement reexecutes. That cycle repeats until the Boolean expression evaluates to false. A while loop statement is known as an entry condition loop because it evaluates the Boolean expression at its top, or entry point. Use the following syntax to express a while loop statement in source code: The do-while loop statement executes a statement and then evaluates a Boolean expression. If that expression is true, the statement reexecutes. The do-while loop statement then reevaluates the Boolean expression. If it is still true, the statement reexecutes. This cycle repeats itself until the Boolean expression evaluates to false. A do-while loop statement is known as an exit condition loop because it evaluates the Boolean expression at its bottom, or exit point. Use the following syntax to express a do- while loop statement in source code: Following the execution of loop-init in the code above, the for loop's loop-test clause executes. loop-test consists of a single Boolean expression that determines whether or not the loop should proceed. If that expression evaluates to true, the for loop proceeds by executing statement. Otherwise, the for loop exits and execution continues with the statement following for (...) statement. A for loop statement is known as an entry condition loop, because it evaluates the Boolean expression at its top, or entry point.
ISSN:1091-8906
1091-8906