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 trialFranklyn Van Dam
403 PointsNeed help. I'm not seeing what I got wrong.
// my error import java.io.Console;
public class TreeStory {
public static void main(String[] args) {
Console console = System.console();
// my code
import java.io.Console;
public class Questions {
public static void main(String[] args)
{
Console console = System.console();
String anyQuestions = console.readline("Are they any questions? \n");
while (anyQuestions.equals("yes"))
{
String question = console.readline("What is your question? \n");
console.printf("I do not understand your question: %s", question);
anyQuestions = console.readline("Are there any more questions? \n");
}
console.printf("Next slide...");
}
}
1 Answer
james south
Front End Web Development Techdegree Graduate 33,271 Pointswell one thing is that the method name is readLine, not readline.
Franklyn Van Dam
403 PointsFranklyn Van Dam
403 PointsI messed up coping error.... here it is....
Questions.java:9: error: incompatible types: String cannot be converted to boolean
String anyQuestions = console.readline("Are they any questions? \n");
^
Questions.java:12: error: incompatible types: String cannot be converted to boolean
String question = console.readline("What is your question? \n");
^
Questions.java:14: error: incompatible types: String cannot be converted to boolean
anyQuestions = console.readline("Are there any more questions? \n");
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors