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 trialryley carlsen
394 PointsWhat part of this is incompatible?..
typing this: String firstName = console.printf("Gordon");
getting this compiler error:
incompatible types String firstName = console.printf("Gordon") ^ required: String found: Void
String firstName = console.printf("Gordon");
String lastName = console.printf("Sumner");
console.printf("Hello %s", firstName);
String band = console.readLine("Which band? ");
1 Answer
Ratul Sarna
Courses Plus Student 11,618 Pointsconsole.printf is a method that does not have a return type. It's only purpose is to print the given string to the console. You are attempting to assign its return value to a String variable. Instead, try using readLine as you do in the last statement.
ryley carlsen
394 Pointsryley carlsen
394 PointsThank you. Noob mistake. haa