c# - What is this behaviour called? -
i have following method:
public override bool issatisfiedby(sourcefile candidate) { console.writeline("check 1: " + one.issatisfiedby(candidate)); console.writeline("check 2: " + two.issatisfiedby(candidate)); console.writeline("check 3: " + three.issatisfiedby(candidate)); return one.issatisfiedby(candidate) && two.issatisfiedby(candidate) && three.issatisfiedby(candidate); }
if pass sourcefile argument not fulfills rule one, rule 2 , 3 aren't checked. know correct way, read more exact behaviour can't find because don't know behaviour called :d
it's called short-circuit evaluation. in c# happens &&
, ||
operators.
Comments
Post a Comment