Else If Statement in Java

Learn  else if Statement in Java

Apples Class

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

int age = 45;

if (age >= 60)
System.out.println(“You are a senior citizen”);
else if (age >= 50)
System.out.println(“You are in your 50s”);
else if (age >= 40)
System.out.println(“You are in your 40s”);
else
System.out.println(“You are a Young”);
}
}

 

 

Share

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.