Aprogramming language uses control statements to cause the flow of execution
to advance and branch based on changes to the state of a program. Java’s program
control statements can be put into the following categories: selection, iteration,
and jump. Selection statements allow your program to choose different paths of execution
based upon the outcome of an expression or the state of a variable. Iteration statements
enable program execution to repeat one or more statements (that is, iteration statements
form loops). Jump statements allow your program to execute in a nonlinear fashion. All
of Java’s control statements are examined here.
If you know C/C++/C#, then Java’s control statements will be familiar territory. In fact,
Java’s control statements are nearly identical to those in those languages. However,
there are a few differences—especially in the break and continue statements.
Your Facebook Friends on WizIQ