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 Objects (Retired) Meet Objects Refresher

can someone help me understand this question plzz or the answer?

I dont know what I did wrong

2 Answers

There's 5 questions in this challenge which will be presented to everyone in a slightly different order each time the challenge is done. My first is:

The boolean datatype is used to store: - the answer to this is true or false

Which method on String will allow you to check if a String is part of another. - contains

What symbol do we use to ensure both of these booleans variables are true: - so this wants to check that one variable AND another are both true. We use the && symbol.

To define a new variable to store a first name it would look something like this: - we need to declare a String, name it using the naming convention and initialize it. That looks like String firstName = "Bob";

Help me compare the weights below. I would like to see if Monty the office Great Dane weighs more than me. - there's two weights. One for the user (Craig) and one for the dog (Monty). The printf remarks on how large the dogs is so the test is "if Monty weighs more than Craig, pass the test". So, that needs the greater than symbol adding: if (weightMonty > weightCraig)

I think that covers each of the questions. Any problms, just shout!

Steve.

T K
T K
1,875 Points

Thank you

Wow, thank you so much steve ! it was so simple smh lol I understand now

No problem! :)

Steve.

Thanks Steve!!! Helped me a lot now i understand lol

:+1: :smile: