Mega Code Archive

 
Categories / Java Tutorial / Statement Control
 

Using (or operator) in if statement

public class MainClass {   public static void main(String[] arg) {     int value = 8;     int count = 10;     int limit = 11;     if (++value % 2 != 0 || ++count < limit) {       System.out.println("here");       System.out.println(value);       System.out.println(count);     }     System.out.println("there");     System.out.println(value);     System.out.println(count);   } } here 9 10 there 9 10