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
billy jones
1,593 Pointsany help? String firstName = console.readLine("what is your name? "); it says I have an incompatible error
Console console = System.console();
// Welcome to the Introductions program! Your code goes below here
String firstName = console.readLine("what is your name? ");
// console print
console.printf("Hello my name is %s\n", firstName);
console.printf("%s is learning how to write java\n", firstName);
String firstName = console.readline("what is your name? ");
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
1 Answer
jacobproffer
24,604 PointsHey Billy,
Are you attempting the IO challenge or compiling this in workspaces/off-site?
billy jones
1,593 Pointsbilly jones
1,593 PointsIts in the io challenge
jacobproffer
24,604 Pointsjacobproffer
24,604 PointsOkay, that makes sense. You don't need to declare or initialize a console object for the challenge. It's already there by default for you in that instance. That's why you're receiving an error.
Here's the complete code if you're stuck:
billy jones
1,593 Pointsbilly jones
1,593 PointsThanks I've been stuck for like an hour