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

For the 4th Line I understand the problem is the variable, but I don't understand how to get to the solution.

For the 4th Line

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

I exchange band for firstName because it's variable but it still doesn't work.

FixMe.java
String firstName = "Gordon";

String lastName = "Sumner";

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

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

2 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi sara oren,

Task 4 to the untrained eye looks fine but the one thing it's missing is a type declaration before band which every variable requires unless your reassigning an already created variables value, simply add String before band and the challenge should pass.

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

Happy coding!

Chris Upjohn, Thanks I did what you said and it worked.

Appreciate the help!