Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Homework Question B.5

+17 votes
Is it just me, or is the homework question B.5 coming back to discrete math?  If we are asking if A AND B are true, they have to be both true, so the method answering "yes" would never run because it is saying if (f() && false).  Right?  Or am I missing something?
asked Oct 13, 2015 in Fall 15-16 by Nick Caputo (100 points)
Strangely enough, what you have written is correct, but you are ALSO missing something...

2 Answers

+6 votes
Best answer
I reached the same conclusion. I also looked up how the && operator worked just to ensure there was nothing weird about how Java might want to interpret that statement.
answered Oct 14, 2015 by Evan Henkel (100 points)
selected Oct 26, 2015 by Nick Caputo
Not the whole story here...
+6 votes
Same here, it is also addressed in the chapter as well.
answered Oct 14, 2015 by Kelsey Self (100 points)
Stonedahl mentioned in comments on my response and the original question that our conclusion was correct but we were missing something. Looking at the chapter, I can't figure out what we're missing. Do you have any ideas?
I just read the chapter, they use a direct example in the book. I don't know what else it would be.