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! While you're at it, check out some resources Treehouse students have shared here.

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

Java Java Basics Perfecting the Prototype Using Logical ORs and ANDs

This is wrong, or? (Logic Quiz: Age)

The question was : "Assuming age is set to 42, what is the value stored in the Boolean answer:"

"Boolean answer = (age (less than) 40 || age (greater than) 50); "

I answered True because (42 (less than) 40 is FALSE || 42 (greater than) 50 is TRUE ) So FALSE (OR) TRUE = TRUE.

But quiz answered False. Why? :S

Matthias J.
Matthias J.
20,355 Points

because 42 is NOT higher than 50 :)

ARGHHH OFC!!!! XD I am so tired! thanks!! :) oh silly me

ARGHHH OFC!!!! XD I am so tired! thanks!! :) oh silly me

1 Answer

Jeremiah Shore
Jeremiah Shore
31,168 Points

Copying the answer from Matthias J. since he replied in the comments, so you mark the question as answered.

@Matthias J.: "because 42 is NOT higher than 50 :)"