Biblioteca Java - Blame information for rev 39
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
39 | mihai | 1 | package introducere.java.operator; |
4 | mihai | 2 | |
3 | /* | ||
4 | * The equality and relational operators determine if one operand is greater than, | ||
5 | * less than, equal to, or not equal to another operand. | ||
6 | * Keep in mind that you must use "==", not "=", when testing | ||
7 | * if two primitive values are equal. | ||
8 | */ | ||
9 | class ComparisonDemo { | ||
10 | |||
11 | public static void main(String[] args){ | ||
12 | int value1 = 1; | ||
13 | int value2 = 2; | ||
14 | if(value1 == value2) System.out.println("value1 == value2"); | ||
15 | if(value1 != value2) System.out.println("value1 != value2"); | ||
16 | if(value1 > value2) System.out.println("value1 > value2"); | ||
17 | if(value1 < value2) System.out.println("value1 < value2"); | ||
18 | if(value1 <= value2) System.out.println("value1 <= value2"); | ||
19 | } | ||
20 | } |