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 Looping until the value passes

matthew glen
matthew glen
14,153 Points

Hello stuck on question 3 of 3, can you tell me which video i need to go back and study to get the answer?

I'm not sure if i'm close with this one, but enjoying the challange

Example.java
// I have initialized a java.io.Console for you. It is in a variable named console.
String response;
boolean validWord;
do {
  response = console.readLine(("Do you understand do while loops?"));
  isInvalidWord = (response.equalsIgnoreCase("yes"));
  if (validWord){
  console.printf("Because you said yes, you passed the test!");
boolean validWord;
do {
  response = console.readLine(("Do you understand do while loops?"));
  isInvalidWord = (response.equalsIgnoreCase("no"));
  if (isInvalidWord){
  console.printf("Please try again");
  }
} while (isInvalidWord);
matthew glen
matthew glen
14,153 Points

Yer got it!!!! thanks alot, knew it would be obvious.

Raul Faure
Raul Faure
596 Points

You are welcome, I am glad! That exercise drove me crazy lol..

1 Answer

Raul Faure
Raul Faure
596 Points

Hi, try the video that is right before this exercise. Hint: for what I see on the screenshot, this is too complex when actually the answer is much simple.