Mega Code Archive

 
Categories / Java Tutorial / Operators
 

Logical OR Operations

The logical OR, ||, omits the evaluation of the right-hand operand when the left-hand operand is true. 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);   } } there 9 11