Java Java Basics Using your New Tools Multiple Strings

Chidiebere Ekennia
Chidiebere Ekennia
544 Points

Error about incompatible types

I'm getting an error message when i'm trying to run my code:

Picked up JAVA_TOOL_OPTIONS: -Xmx128m Picked up _JAVA_OPTIONS: -Xmx128m TreeStory.java:14: error: incompatible types: String cannot be converted to boolean String adjective = console.readline("Enter an adjective: "); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output

2 Answers

Tonnie Fanadez
Tonnie Fanadez
UX Design Techdegree Graduate 20,993 Points

Hello Chidiebere Ekennia

I see you are liking Java code.

Alright, your error is on the readLineMethod() - the L in readLine() should be in Capital.

Please see this snippet.

//your code on line 14
String adjective = console.readline("Enter an adjective: ");

//try out this code instead, save and run the code
String adjective = console.readLine("Enter an adjective: ");

Please let us know how it goes. Tonnie

Chidiebere Ekennia
Chidiebere Ekennia
544 Points

Thanks Tonnie. silly mistake, lol