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

Sebastian Jørgensen
Sebastian Jørgensen
504 Points

What to do here?

Im missing something here but i cant seem to figure out what it is? Any help???

Example.java
do{
String response = console.readLine("Do you understand while loops?");
if(response.equalsIgnoreCase("no"){
  console.printf("Wrong answer. Try again");
}

  while(response.equalsIgnoreCase("no"); 

2 Answers

Thomas Nilsen
Thomas Nilsen
14,957 Points

you're missing a parenthesis at the end:

while(response.equalsIgnoreCase("no")); 
Sebastian Jørgensen
Sebastian Jørgensen
504 Points

Thank you. Im still missing something, as the program tells me that my code is taking to long to proces

Chris Tvedt
Chris Tvedt
3,795 Points

You might be missing a "}". You have your IF statement in {} but the "Do-While-loop" seems to be missing a "}" before the "While"

Chris Tvedt
Chris Tvedt
3,795 Points

You are also missing a ")" athe end of the IF-statement.