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

1 Answer

Walter Allen
seal-mask
.a{fill-rule:evenodd;}techdegree
Walter Allen
iOS Development with Swift Techdegree Student 16,023 Points

Hey there. The three questions are below (although they appear in a random order when you regenerate the quiz):

This question asks you to decide if Monty weighs MORE THAN Craig. Therefore, you would need to use one of the comparison operators (<, >, ==, !=). In this case, you would use the one that means greater than (>). int weightCraig = 160; int weightMonty = 130; if (weightMonty ___ weightCraig) { console.printf("Whoa that's a huge dog!"); }

This question asks you to make sure that both isRefreshed AND isReadyToGetStarted are true. Therefore, you'll need to use one of the logical operators: && or ||. In this case, you'll want to use the one that means AND. boolean shouldContinue = isRefreshed ___ isReadyToGetStarted;

This question asks you to determine the String method that will check within a given string and see if it contains another string that you pass it in the parameter. In other words, does the string "These are words" contain the string "words." One great resource for looking at the methods in the String class is the java docs documentation which can be found at: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html. I suggest looking at the list of methods that begin with the letter 'c'. String someWords = "These are words"; someWords.__________("words");

Do these hints help? I could give you the answers, but I feel that it's more important to learn what's going on and how to use the documentation. If you'd rather just have the answers, let me know, and I'll post them here, but this should be enough to get you through the quiz. :) Happy coding!