Program Flow and Sequential Structure in Java Programming
Program Flow and Sequential Structure
Flow
- The order in which statements are executed when a program runs.
Flow control statements are used to control the execution order of statements in a program.
Structured programming design specifies three basic flow structures:
- Sequential Structure
- Branch (Selection) Structure
- Loop Structure
I. Statements
- Simple Statements
- End with
;
, representing an action to be executed, which can be assignment, judgment, or jump, etc.
- End with
- Compound Statements
- A block of statements enclosed in
{}
, generally consisting of multiple statements.
- A block of statements enclosed in
II. Sequential Structure
The sequential structure is the simplest of the basic control structures. In the sequential structure, program statements are executed in the order they are written.
- No need for special flow control statements
- Write statements in the desired execution order
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 程俞客&称心号!
评论