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 trialTed Clayton
Courses Plus Student 206 PointsChallenge #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?
2 Answers
Long Nguyen
10,007 PointsYou 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");
}
Ted Clayton
Courses Plus Student 206 PointsLong 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.
remi poolen
6,697 Pointsremi poolen
6,697 Pointsin 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?