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

Prompt the user with the question "Do you understand do while loops?" Store the result in a new String variable named re

hoe to do?

Example.java
// I have initialized a java.io.Console for you. It is in a variable named console.
console.readLine(" do you understand do while loop?  ");
String response ;
do{
  response = "no";

}
while(response = "yes");

1 Answer

Fahad Mutair
Fahad Mutair
10,359 Points

hi Sreekanth Surendran , those steps will help you understand this Challenge

  1. Declare your variable String response.
  2. Declare your do while loop.
  3. Inside do body you have to store the answer of your question ("Do you understand do while loops?") in response variable.
  4. in while, you have to put the Logic that keeps this Loop to continue asking till it didn't match this statement.