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

coding challenge

// band=console.readline("which band? ");

FixMe.java
// Sting firstName = "Gordon";
String firstName=console.readLine("Gordon");
// string lastName = "Sumner";
String lastName=console.readLine("Sumner");
// console.printf("Hello %s", firstName)
console.printf("%Hello%s",firstName);
// band = console.readLine("Which band?  ");
String band=console.readLine("Which band? ");

Thank you sir i appreciate

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

Adding answer for others to reference:

// Task 1
// I have placed several errors in this challenge. To fix them you
// must remove the // to uncomment them and then correct the error.
// Uncomment the first line and fix the error. If you do not see the
// error, click submit and view the Preview pane to view the compiler
// error.
String firstName = "Gordon"; // Sting misspelled

// Task 2
// Now uncomment and correct the second line. If you do not see the
// error, click submit and use preview tab to see the compiler output.
String lastName = "Sumner"; // string not capitalized

// Task 3
// Uncomment the third line and correct the mistake. If you aren't
// sure, click the Check Work button and then use the preview tab
// to see the compiler error.
console.printf("Hello %s", firstName); // missing trailing semi-colon

// Task 4
// Finally, uncomment the last line and correct it. This one seems
// to be missing the data type declaration at the start of the
// statement. Press Check Work if you don't see the mistake, and
// then click Preview to see the compiler error.
String band = console.readLine("Which band?  "); // add missing String