if condition (Selection Statement)

If condition block will be executed, when the condition inside is true.

Example: Simple if condition

public class IF_Example1
{
       public static void main(String[] args) 
       {
             int x=100;
               int y=50;
               if(x>y)
               {
                       System.out.println("x is greater");
               }
       }
}

Example 2

public class IF_Example2
{
       public static void main(String[] args) 
       {
          int score=82;
          if(score>70)
          {
           System.out.println("pass");
           }      
  }
}