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

Java

commend String Name = console.readline("enter your name"); returning error incompatable data

returning error incompatible data type string can't be converted to boolean

Can you show me the code of your program?

import 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

Use

String name = console.readLine("What is your name? ");

Remember, 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)