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 trialryann ma
2,682 PointsI have an error. I wrote it just like the teacher wrote it but still
Picked up _JAVA_OPTIONS: -Xmx128m
^[[ATreeStory.java:13: error: incompatible types: String cannot be converted to boolean
String name = console.readline("Enter your name: ");
^
TreeStory.java:14: error: incompatible types: String cannot be converted to boolean
String adjective = console.readline("Enter your name: ");
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
2 Answers
Joshua Jones
Full Stack JavaScript Techdegree Student 3,735 PointsAs long as you initialized console, your code is correct, but you have to remember to camelcase. So readline should be readLine.
Console console = System.console(); String name = console.readLine("Enter your name:")
ryann ma
2,682 PointsThanks joshua!
Patrik Horváth
11,110 PointsPatrik Horváth
11,110 PointsIf i kniw console is with big C izs like System.in .....
So Console.readline
With small latter its atribute but you never made atribute console with big latter you call Static methods for exaple