Nested if Statements

Learn  Nested if Statements in Java

Apples Class

class Apples {
public static void main(String[] args) {

int age = 60;

if(age < 50){
System.out.println(“You are young”);
} else {
System.out.println(“You are old”);
if(age > 75){
System.out.println(“You are really old”);
} else {
System.out.println(” Dont worry You arent that old”);
}
}

}
}

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.