Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Grigor Samvelian2,852 Points
conditional-or operator question
Hi, in the teachers notes of the video Methods | C# Objects its stated in the truth table of the conditional-or operator that if x is false and y is true the result would be true, but from my understanding of the conditional-or operator that the answer should be false because x is false and x is evaluated first. Could someone please explain to me why the result would be true, thank you!
Tsenko Aleksiev3,819 Points
AND - both sides of the operator must be true in order the result to be true. If only one side is false, than the result is false. OR - it needs only one side if the operator, no matter which one, to be true in order the result to be true. If both are false, only than the result is going to be false. Think of it: Bodyguard at the entrance of a disco: he only passes if you are a boy AND you have 18. The next day he passes only if you have 18 OR you a dressed as a cloun. Got it?