These two days, we studied Control Statements used in Java. These were similar to those that we used in C++. 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.
Java supports two selection statements: if and switch.Java’s iteration statements are for, while, and do-while.Java supports three jump statements: break, continue, and return. All these Control Statements together provide great flexibility to our programs and are really very powerful. The rest is all about their syntax.
Java supports two selection statements: if and switch.Java’s iteration statements are for, while, and do-while.Java supports three jump statements: break, continue, and return. All these Control Statements together provide great flexibility to our programs and are really very powerful. The rest is all about their syntax.