Lesson 7 - Conditional Statements in Java
Lesson 7 - Conditional Statements in Java
in Java
Topics to be covered
1. Introduction to Conditional Statements
2. Types of Conditional Statements
a. if statement
b. Multiple use of if
c. if-else statement
d. Nested if statement
Mind Map
Control Statements
The syntax is :
if(condition)
{
Set of statements;
}
if(condition)
{
Set of statements;
}
if else Conditional Statement
The if else statement only executes when either of the two actions are
to be performed depending upon certain conditions.
The syntax is :
if(condition)
{
Set of statements;
}
else
{
Set of statements;
}
if else if else Statement
It works with multiple conditions. Whenever the condition is true,
the associated statement will be executed and the remaining
conditions will be bypassed. If none:of the conditions are true then
the else block will execute The syntax is ->
if(condition)
statements;
else if (condition)
statements;
else if(condition)
statement;
else
statements;
if else if else Statement