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

RISHABH HURSHAN
RISHABH HURSHAN
737 Points

shows cannot find symbol on "."

String response; do { response = console.readline("that question:"); }

while(response.equalsIgnoreCase("NO"));

Whats wrong

Example.java
// I have initialized a java.io.Console for you. It is in a variable named console.
String response;
do {
  response = console.readLine("Do u understand d loops");
} while (response.equalsIgnorecase("NO"));

2 Answers

Rob Bridges
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 Points

Hey there Rishabh,

I see that you already got this sorted out, but your hunch is exactly right, in the example you showed us the error would crop up at equalsIgnoreCase, because the 'c' wasn't capitalized. What this error means is that it couldn't find the method that you were trying to call. It looks like you went through and did it again and sorted it out though, so good job.

What I wanted to clarify was the reason it pointed at the dot, that dot is useful, but not at all 100% correct, think of it more like a hint than an absolute answer. It pointed to the dot because the dot was the last thing that Java compiled correctly, when it got to the method after it it didn't find the method due to the letter not being capitalized, so it pointed you to where it believes the error occurred.

In any case, good job finding it out, hope the explanation clarifies a bit.

You might be failing due to using the longer method call or for NO being capitalised.

The following gets past that part:

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

Steve.

RISHABH HURSHAN
RISHABH HURSHAN
737 Points

i used (response.equalsIgnoreCase("no"));

that removes the casing of it ........

anyways i tried again .....turns out the problrm was "readLine" was wriiten "readline"

but i wonder why the error was cannot find symbol that to on ". "