• Conditions are like questions. They allow a program to decide to take one action if the answer to a question is true or to do another action if the answer to the question is false.
  • if-else
  • int age = 25;
    if(age < 50) {
    	println("you are young");
    }
    
  • if-else
  • int age = 25;
    if(age > 50) {
    	println("you are old");
    }else{
    	println("you are still young");
    }
    
  • if-elseif-else
  • int age = 25;
    if(age < 25) {
    	println("you are still young");
    }else if(age > 25 && age < 50) {
    	println("Middle age");
    }else{
    	println("you are old");
    }