Nested if statement

Last updated on:

if(i > k){
   if(j >k){
     System.out.println("i and j are greater than k");
}
else
    System.out.println("i is less than or equal to k");
};

Here is the best practice of using multiple if else statements:

if (x >= 100){

}
else if (x >=90){

}
else if (x >=80){

}
else {

}
View Comments

Leave a Comment

Use markdown or basic HTML and be nice.