This module explores the flow of Java programs and shows you how to alter program flow using
- and loops.
You will begin the module by learning how to use conditional branches such as
You will then move on to learn the basics of loops, including how to use the
From there, you will learn about
and you will get some tips on how to control loops in general.
Can you imagine trying to write code using a language that did not give you a way to execute statements conditionally?
Flow control is a key part of any useful programming language, and Java offers several ways to accomplish it.
Some statements, such as if statements and for loops, are common to most languages.
But Java also throws in a couple of flow control features you might not have used before, namely exceptions and assertions.