If Else Statement

Source Code

package myPackage;

public class If_ElseStatement {


/* Comparison Operators

  ==  is equal to

  !=  is not equal to

  >   is greater than

  <   is less than

  >=  is greater than or equal to

  <=  is less than or equal to

*/

public static void main(String[ ] args) {

int x= 10;

if(x == 20) {

System.out.println("Yes x == 10");

}else {

System.out.println("No x != 10");

}

}

}

Result

No x != 10

Post a Comment

0 Comments