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

luka lazarevic
luka lazarevic
414 Points

someone help i m new

why is noun problem here

Example.java
// I have initialized a java.io.Console for you. It is in a variable named console.
String response;
boolean No;


do {
  response=console.readLine ("Do you understand do while loops?");
  No = (noun.equalsIgnoreCase("No"));
  if (No) {
    console.printf("sadas");
  }

}while(No);

1 Answer

Hey Luka,

There is no need for a boolean or an if statement with this challenge. You simply need to continuously prompt the user until the value returned is something other than "No".

You should have something similar to:

String response;
do {
  response = console.readLine("do you understand do while loops?");
} while(response.equals("No"));

With that being said, keep in mind that these challenges test for specific answers.

luka lazarevic
luka lazarevic
414 Points

ty man :D i understand now :)