Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

boolean operators in Java

int a = 4;
int b = 5;
boolean result;
result = a < b; // true
result = a > b; // false
result = a <= 4; // a smaller or equal to 4 - true
result = b >= 6; // b bigger or equal to 6 - false
result = a == b; // a equal to b - false
result = a != b; // a is not equal to b - true
result = a > b || a < b; // Logical or - true
result = 3 < a && a < 6; // Logical and - true
result = !result; // Logical not - false
Source by www.learnjavaonline.org #
 
PREVIOUS NEXT
Tagged: #boolean #operators #Java
ADD COMMENT
Topic
Name
3+7 =