| layout | default |
|---|---|
| title | if-else |
| parent | Simple If |
| grand_parent | Control Statement |
| nav_order | 2 |
The Java if-else statement also tests the condition. It executes the if block if condition is true otherwise else block is executed.
Syntax:
if(condition){
//code if condition is true
}else{
//code if condition is false
} 