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 trialNicholas Demetriou
639 PointsChallenge Task 4 of 4
I can get around challenge 4, any help?
//
String firstName = console.readLine("Enter your firstName: ");
//
String lastName = console.readLine("Enter your lastName: ");
//
console.printf("Hello I am %s %s", firstName, lastName);
//
String bandName = console.readLine("Enter your bandName: ");
//
console.printf("Which %s do you like?", bandName);
3 Answers
Benjamin Simmons
50,431 PointsNot sure why you have some the extra stuff there, but the correct code that is needed to pass is:
String firstName = "Gordon";
String lastName = "Sumner";
console.printf("Hello %s", firstName);
String band = console.readLine("Which band? ");
The only thing needed to pass the final step 4 is to add 'String' to the front of the uncommented line.
Nicholas Demetriou
639 PointsThanks both for your responses
Craig Dennis
Treehouse TeacherThose additional console.readLine
calls at the beginning are not needed, the bug was in the data type, which you corrected. I have a bug in my code that I'm working on fixing. Sorry about that!