chris.chen
08/24/2019, 2:37 PMand
&&
for example:
val a = 3
val b = 4
val c = 5
val d = 3
val result1 = b == c && a == d
val result2 = (b == c) and (a == d)
1) the result2 if we write val result2 = b == c and a == d
will not work. not sure why
2) For result1 because the b==c is false. so will not run a==d case. but result2 will get false false so finally will be false. which means result1 only perform one time check and result2 perform 2 times check.
Is my understanding correct?karelpeeters
08/24/2019, 2:54 PM((b == c) and a) == d
.karelpeeters
08/24/2019, 2:54 PMchris.chen
08/24/2019, 2:55 PMand
or
🤔karelpeeters
08/24/2019, 3:00 PMchris.chen
08/24/2019, 3:07 PM