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 - Using String Equality

Challenge #2 won't run

if (firstExample.equalsIgnoreCase(thirdExample)) { console.prinf("first and third are the same ignoring case. \n\n." );

The code above won't run. What is wrong with it?

in this particular piece of code you are missing a closing curlybracket on your if-statement ( this one: } ). But i cant see the exact assignment or the errormessage so if this was not the correct solution maybe you can add the link to your exact code in the assignment?

2 Answers

You have a couple syntax errors. First you're missing a closing bracket at the end of the if statement (You can always omit brackets if you have single line statements). Second you misspelled printf.

It should look like this:

if(firstExample.equalsIgnoreCase(thirdExample))
{
  console.printf("first and third are the same ignoring case");
}

Long and Remi, Thank you for the reply. When I ran it yesterday it worked and I corrected printf and ended it with a closing curly bracket.