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 Basics Perfecting the Prototype Censoring Words - Looping Until the Value Passes

Kevin White
PLUS
Kevin White
Courses Plus Student 560 Points

illegal start of type if

I am trying to complete the lesson, however, I am receiving the following errors.

TreeStory.java:29: error: cannot find symbol
if (isInvalidword) {

TreeStory.java:29: error: illegal start of type
if (isInvalidword) {

I understand it is pointing to line 29, I'm not sure what I am missing though.

boolean isInvalidWord; do { noun = console.readLine("Enter a noun: "); isInvalidWord = (noun.equalsIgnoreCase("dork") || noun.equalsIgnoreCase("jerk")); if (isInvalidword) { console.printf("That language is not allowed. Try again \n\n"); } } while(isInvalidWord);

Any help is appreciated!

1 Answer

Kevin White
Kevin White
Courses Plus Student 560 Points

I did not see that I mistyped that! Thank you!