The if statement with the or (||) operator

The or (||) operator is a fairly lenient operator which returns true when either of the two conditions in the group is true.  The if statement fails when both conditions are not satisfied and skips the respective code block until one of the grouped conditions is satisfied. The if with || operator can be written in symbol form:

if ((b > a) || (b > c)) {
println("b is a winner")
}

The or operator can be written in word form:

if (b > a or b > c) {
println("b is a winner")
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.60.62