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 Java Objects (Retired) Creating the MVP Prompting for Guesses

getting null Exception error when run the code.. ./Prompter.java:1: error: cannot find symbol

./Prompter.java:1: error: cannot find symbol
import java.io.console;
^
./Prompter.java:12: error: incompatible types: String cannot be converted to boolean
String guessAsString = console.readline("Enter a letter: ");
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

Kevin Faust
Kevin Faust
15,353 Points

Hey Varun can you post your entire code?

2 Answers

Athanasios Kourtzis
Athanasios Kourtzis
6,437 Points

Without knowing how your code looks like I guess, from reading your error message, that your import on top of your code should be like this

import java.io.Console;

The letter c should be uppercase. Since you have the error message "./Prompter.java:1: error: cannot find symbol import java.io.console; " fixing the typo should be enough.

You also forgot to capitalise the C in that line. ;)