Home >Web Front-end >JS Tutorial >control flow statement ?
The control flow statement in the program is part of the core component of the programming language, which determines the execution order of the instruction in the program. They allow programs to perform code block multiple times, execute code blocks according to conditions, terminate or skip the execution of specific code rows, and so on.
<code class="language-java">package day1; public class While_basic { public static void main(String[] args) { // 初始化计数器 int count = 1; // 循环条件:当 count 小于等于 5 时,执行循环体 while (count <= 5) { // 打印当前计数器的值 System.out.println(count); // 计数器加 1 count++; } } }</code>Program output:
The above is the detailed content of control flow statement ?. For more information, please follow other related articles on the PHP Chinese website!