wood burning stoves 2.0*
The moose likes Associate Certification (SCJA,OCAJ 5/6) and the fly likes McKenzie's Mock Exam Question 13-3 on pg. 286 has wrong answers. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Associate Certification (SCJA,OCAJ 5/6)
Bookmark "McKenzie Watch "McKenzie New topic
Author

McKenzie's Mock Exam Question 13-3 on pg. 286 has wrong answers.

Todd Patrick
Ranch Hand

Joined: Jan 30, 2004
Posts: 31

I believe the answers are wrong for question 13- 3 on page 286 in the McKenzie's Mock Exam Questions book.

The question is:

Given the declarations below, which of the following conditional statements would evaluate to true?



a) (x1<x2)&&(x2>x1)
b) (x1<x2)||(x2>x1)
c) ! (b == true) && (x1 > d)
d) (b == true) && (x1 > d)

On page 295, it lists the correct answers as a, b, c - which I believe it should be a, b, d. I'm using Java(TM) SE Runtime Environment (build 1.6.0_18-b07).

Answer c cannot evaluate to true because of the exclamation point before the left hand expression. The right hand expression does result in true, but the left hand expression would result in false.

Am I missing something here?


--Todd
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Indeed. It was an error in the book.

Thanks for the update!

-Cameron
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: McKenzie's Mock Exam Question 13-3 on pg. 286 has wrong answers.
 
Similar Threads
urgent help on K&B chapter 7 Self Test Questions
IBM mock
mock question about "case"
Bates/Sierra SCJP 5.0 MasterExam Error
Doubt from K&B ch 5