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 trialCarla Barrios
636 PointsHow do I fix JavaTester.java122: error: I cannot find symbol?
I was trying to write a do while loop in which the code continue running as long the response is "No".
Carla Barrios
636 PointsString response = console.readLine("Do you understand do while loops"); do { String noun = console.readLine( "Enter a noun"); if(noun.equalsAllowCase("No")) console.printf("No./n/n"); }while(noun.equalsAllowCase("No"));
1 Answer
Adomas Domeika
6,151 PointsThere is no such method as equalsAllowCase - it should be equalsIgnoreCase.
Just tested the code, the thing is - if you declare the variable in brackets - {}, then it is unreachable after them. So, in 'do, while' loop the noun is declared in do, this means, that while doesn't know what the hell is this variable - noun. What fixed the problem - declare the variable noun in the second line of the code.
Adomas Domeika
6,151 PointsAdomas Domeika
6,151 PointsCan you please show your code? Because it is impossible to say what the problem is without seeing the code...