In this section, we will discuss about Branching Statements in java 7. This is one type of control flow statement.
Branching Statements :
Branching statements are categorize in the following types :
Break Statement :
The functionality of break statement is to break the flow of your loop (do-while, while, for or switch statement). In switch statement we use break at the end of each case statement.
Continue Statement :
Continue statement is another branching statement provided by the java 7. Its functionality to stop the current iteration of the specified loop and continue execution with the next iteration.
Return Statement :
It is another branching statement. The functionality of return statement is to exits the current method and it returns the flow of your control to the method is called.
You can also return some value by using the return statement.
Condition is that the data type of return value and the return type of method must be same.
Posted on: December 24, 2012 If you enjoyed this post then why not add us on Google+? Add us to your Circles