Control structures:
Control structures are mostly used to control the flow of your program. Java provides the following control structures.
- if statement: Allows you to check for conditions in your application.
- Syntax: –
- if(condition)
statement; - if(condition)
{- statements;
}
else
if(condition)
{- statements;
}
else
- if(condition)
- Syntax: –
