Control Statement and Looping

1.1 if else

if else loop is use for condition check. The if-then statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular test evaluates to true.
Learn More ...
switch case is used to check a number of possible execution paths. A switch can work with the byte, short, char and int primitive data types.
Learn More ...
for loop allows a code to be repeatedly executed. A for loop is classified as an iteration statement.
Difference between while and do while is that while statement continually executes a block of statements while a particular condition is true whereas do while evaluates its expression at the bottom of the loop instead of the top. Therefore, the statements within the do block are always executed at least once.
Learn More ...
In JDK 1.5 (tiger) release of Java new feature of the enhanced for loop was introduced. Enhanced for loop allows you to iterate through a collection without having to create an Iterator or without having to calculate beginning and end conditions for a counter variable.
Learn More ...
Here you can find Some basic control statement examples.