Documentation

The Java™ Tutorials
Hide TOC
Control Flow Statements控制流语句
Trail: Learning the Java Language
Lesson: Language Basics

Control Flow Statements控制流语句

The statements inside your source files are generally executed from top to bottom, in the order that they appear.源文件中的语句通常按照它们出现的顺序从上到下执行。Control flow statements, however, break up the flow of execution by employing decision making, looping, and branching, enabling your program to conditionally execute particular blocks of code.然而,控制流语句通过使用决策、循环和分支来分解执行流,使您的程序能够有条件地执行特定的代码块。This section describes the decision-making statements (if-then, if-then-else, switch), the looping statements (for, while, do-while), and the branching statements (break, continue, return) supported by the Java programming language.本节介绍Java编程语言支持的决策语句(if-thenif-then-elseswitch)、循环语句(forwhiledo-while)和分支语句(breakcontinuereturn)。


Previous page: Questions and Exercises: Expressions, Statements, and Blocks
Next page: The if-then and if-then-else Statements