Circles in Java.For students
Предмет: | Информатика |
---|---|
Категория материала: | Презентации |
Автор: |
Dudnik Oxana Antonovna
|
There may be a situation when we need to execute a block of code several number of times, and is often referred to as a loop.
Java has very flexible three looping mechanisms. You can use one of the following three loops:
while Loop
do...while Loop
for Loop
As of Java 5, the enhanced for loop was introduced. This is mainly used for Arrays.
Break. A for-loop can be stopped at any time, based on any condition. We use the "break" statement. It takes no arguments and terminates the nearest enclosing loop.
Continue. This keyword stops the current loop iteration and moves to the next one. Further statements are not executed. In a loop with an iteration condition, the next iteration begins.
Тип материала: | Презентация Power Point (ppt) |
---|---|
Размер: | 1.6 Mb |
Количество скачиваний: | 8 |