Biblioteca Java - Blame information for rev 39

Subversion Repositories:
Rev:
Rev Author Line No. Line
39 mihai 1 package introducere.java.operator;
4 mihai 2  
3  
4 /**
5  *The && and || operators perform Conditional-AND and Conditional-OR operations on
6  *two boolean expressions. These operators exhibit "short-circuiting" behavior, which
7  * means that the second operand is evaluated only if needed.
8  */
9 class ConditionalDemo1 {
10  
11     public static void main(String[] args){
12          int value1 = 1;
13          int value2 = 2;
14          if((value1 == 1) && (value2 == 2)) System.out.println("value1 is 1 AND value2 is 2");
15          if((value1 == 1) || (value2 == 1)) System.out.println("value1 is 1 OR value2 is 1");
16  
17     }
18 }