본문 바로가기
Java 배우기

Summary of Control Flow Statements

by 노화방지 Anti-aging Hairstyle 2016. 1. 5.
반응형


The if-then statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular test evaluates to true. The if-then-else statement provides a secondary path of execution when an "if" clause evaluates to false. Unlike if-then and if-then-else, the switch statement allows for any number of possible execution paths. The while and do-while statements continually execute a block of statements while a particular condition is true. The difference between do-while and while is that do-while evaluates its expression at the bottom of the loop instead of the top. Therefore, the statements within the do block are always executed at least once. The for statement provides a compact way to iterate over a range of values. It has two forms, one of which was designed for looping through collections and arrays.


반응형

'Java 배우기' 카테고리의 다른 글

Lesson: Classes and Objects 단원: 클래스와 객체  (0) 2016.01.05
Questions and Exercises: Control Flow Statements  (0) 2016.01.05
Branching Statements  (0) 2016.01.05
The for Statement  (0) 2016.01.05
The while and do-while Statements  (0) 2016.01.05

댓글