diff --git a/examples/binary-operators/binary_operators.bal b/examples/binary-operators/binary_operators.bal index 84055b74b7..bc108875eb 100644 --- a/examples/binary-operators/binary_operators.bal +++ b/examples/binary-operators/binary_operators.bal @@ -24,6 +24,7 @@ public function main() { int remainder = b % a; io:println(remainder); + // `>`, `<`, `>=` and `<=` are use to perform the relative order of two values. // Check if `a` is less than `b`. boolean isLessThan = a < b; io:println(isLessThan); @@ -70,6 +71,10 @@ public function main() { boolean logicalOr = c || d; io:println(logicalOr); + // `false` is considered less than `true`. + boolean isLessThanBoolean = d < c; + io:println(isLessThanBoolean); + int g = 10; int h = 20; @@ -103,4 +108,8 @@ public function main() { // Concatenate two strings. string concatenatedString = i + " " + j; io:println(concatenatedString); + + // Check if `i` is lexicographically greater than `y` in Unicode code point order. + boolean isGreaterThanString = i > j; + io:println(isGreaterThanString); } diff --git a/examples/binary-operators/binary_operators.out b/examples/binary-operators/binary_operators.out index 24e87e1b56..40652429e5 100644 --- a/examples/binary-operators/binary_operators.out +++ b/examples/binary-operators/binary_operators.out @@ -14,6 +14,7 @@ true false false true +true 0 30 30 @@ -21,3 +22,4 @@ true 2 2 Hello Ballerina +true