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
Abhinav Sharma
421 Pointscommend String Name = console.readline("enter your name"); returning error incompatable data
returning error incompatible data type string can't be converted to boolean
Abhinav Sharma
421 Pointsimport java.io.Console; public class Is { public static void main (String[] args) { Console console = System.console(); String Name = console.readline("enter your name?"); console.printf("my name is %s" , Name); } }
1 Answer
Saiteja Vemula
7,162 PointsUse
String name = console.readLine("What is your name? ");
Saiteja Vemula
7,162 PointsRemember, anything that has more than one word in it, it will use Capital Letter for all the letters at the beginning of the word except for the first word.
In this case, 'readLine' has two words, so the second word's first letter would be capital letter. (Its because of naming conventions)
Saiteja Vemula
7,162 PointsSaiteja Vemula
7,162 PointsCan you show me the code of your program?