Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 674 Bytes

ifelseif.md

File metadata and controls

34 lines (28 loc) · 674 Bytes
layout default
title if-else-if
parent Simple If
grand_parent Control Statement
nav_order 3

Java if-else-if ladder Statement


The if-else-if ladder statement executes one condition from multiple statements.

Syntax:

    if(condition1){  
    //code to be executed if condition1 is true  
    }else if(condition2){  
    //code to be executed if condition2 is true  
    }  
    else if(condition3){  
    //code to be executed if condition3 is true  
    }  
    ...  
    else{  
    //code to be executed if all the conditions are false  
    }  

ifelseif