Condition Checking inside if (AND)

Java Programming Language / Decision Making in java

1669

Program:

class conditionCheck {
public static void main(String args[])
  {
  int num1 = 10;
  int num2 = 20;

  if  ((++num1 < 0) && (++num2 > 0))
     {
     System.out.println(num1);
     System.out.println(num2);
     }

      System.out.println(num1);
     System.out.println(num2);

  }
}

Output:

11
20
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.