·  JAVA – Syntax – Conditional Statements – if...else

 

- Info:

  - This tutorial shows how to use if conditional statements.

 

- Procedure:

  - Create JAVA Console Application Test.java

 

    Test.java

    public class Test {

      

      public static void main (String arg[]) throws Exception {

   

        int    value = 10;

        String text  = "bird";

        

        if      (value == 10        ) { System.out.println("Value = 10"      ); }

        else if (text.equals("bird")) { System.out.println("text equals bird"); }

        else                          { System.out.println("No match found"  ); }

 

      }

      

    }