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 Using your New Tools Fix the Errors

Which band? Mach 2

I am still stuck on Challenge task 4 of 4.

I have added the declaration...

String bandName = "The Police";

and have changed the last line to...

console.printf ("Which band? ");

rather than console.readLine("Which band? ");

I receive the following error...

JavaTester.java:123: error: cannot find symbol if (!band.startsWith("RESULT")) { ^ symbol: variable band Location: class JavaTester 1 error

I know it is one small detail to correct but cannot find the solution. Any assistance would be appreciated.

R.

FixMe.java
 String firstName = "Gordon";

 String lastName = "Sumner";

 String bandName = "The Police";

 console.printf("Hello %s", firstName);

 console.printf("Which band?  ");

1 Answer

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Sorry this is giving you so much trouble. I just wanted you to add the String declaration to the line, it was the missing error:

String band = console.readLine("Which band?  ");

Should pass with flying colors.

Hope it helps! And sorry for the frustration!

Thank you Craig.

I can see I was over complicating things.

I appreciate your help.

Many thanks.

R.