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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Berkay Gökkaya](https://secure.gravatar.com/avatar/452c361040587dc8ce43e5bb8cab8357?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Berkay Gökkaya
2,316 PointsHelp doing the loop
I dont know how to do the loop correctly.
// I have initialized a java.io.Console for you. It is in a variable named console.
String response= console.readLine ("Do you understand do while loops?");
do {
while(response.equals("No");
}
2 Answers
![Mark Sebeck](https://uploads.teamtreehouse.com/production/profile-photos/6569772/micro_mark.jpg)
Mark Sebeck
Treehouse Moderator 37,777 PointsHi Berkay. Simply moving:
response= console.readLine("Do you understand do while loops?");
inside the loop should fix it.
You do still need to declare response outside the loop
![Mark Sebeck](https://uploads.teamtreehouse.com/production/profile-photos/6569772/micro_mark.jpg)
Mark Sebeck
Treehouse Moderator 37,777 PointsHi Berkay. You have the basic structure of the Do While loop but you have a couple of Syntax errors. First on the while loop you open Parentesis twice but only close once. So add another ) to the end of your while.
while(response.equals("No"));
Also the curly brackets should close before the while statement not after.
}
while(response.equals("No"));
Now we need to think about what should go inside the loop. Each time you are going to check if the response = "No". If it equals "No" you loop again. If it doesn't equal No then you exit. So you should probably ask the user each time if they understand loops. Hope this helps and post back if you are still stuck
![Berkay Gökkaya](https://secure.gravatar.com/avatar/452c361040587dc8ce43e5bb8cab8357?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Berkay Gökkaya
2,316 PointsHey Mark,
thank you very much already. But I still need help. How do I continue from here on:
String response= console.readLine("Do you understand do while loops?");
do {
} while(response.equals("No"));