Control and Branching Structures in Java.

In this article, Control and Branching Structures in Java is explained in detail with examples.
Control Structure.
In general program execution starts with main() and it follows line by line/linear/sequential flow of execution takes place until the end of main().
Ex:
public static void main(String args[])
{-----
------
body   // (Linear Flow of Execution/Step by step execution)
-----  
------
}

Multiple if and If-else control structures.

In this article,Multiple if and If-else control structures are explained in detail with examples.
In this control structure, we use multiple if statements one after the other/sequential as follows.
Syntax
if(condition 1)
{---
body1;
---
}
if(condition 2)
{---
body2;
------
}

Nested-if control Structure.

In this article,Nested-if control Structure is explained in detail with examples.
In this, you will come to know about the Nested if control structure Using an if-condition block inside another if condition block is known as nested-if.
Syntax
if(condition 1)
{
outer true part;
}
if(condition 2)
{
Inner true part;
}
----
}

Cascading If-else control Structure.

In this article, Cascading If-else control Structure is explained in detail with examples. you will come to know about what is the cascading If-else control structure in Java, how it is defined in java program.Syntax is written as below
Syntax
if (condition 1)
{
true part1;
}
else if (condition 2)
{
true part2;
}
else if (condition 3)

Switch case control structure.

In this article,Switch case control structure is explained in detail with examples.This control structure works same as that of cascading if else provided we use proper break statements and control the execution.
Syntax
switch(expressions)
{
case value1:
---statement1---
break;
case value 2:
---statment2---

Connect with Us by Subscribing here for more Updates..!

* indicates required