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

Coding Error or Treehouse Error

I've spent over an hour trying to find the error in my code for part 2. Can somebody please tell me what is wrong as I'm almost convinced its an error with treehouse now

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

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Robert,

First, I've added Markdown to your post so that the code block is readable. Without Markdown, code blocks are very hard to read in the Community. Please refer to the Markdown Cheatsheet located above the Post button on the Question page or have a quick go at the Markdown Basics Course
Also, it's best to link a question directly from the challenge in question. This will link the correct challenge and relevant code into your post automatically. Just click the "Get Help" button.

Now in regards to your question... The code above is correct, but the fact that I'm not seeing all the code for the tasks, I'm going to guess that you deleted the code for the first task? This would be your error. The instructions did not say to delete the previous code block. In Treehouse challenges, unless specifically instructed to do so in the instructions, you shouldn't add extra, delete any, or modify code that you've already entered. Tasks are always cumulative and the code checking engine expects and requires it to pass.

In short, your code is correct - All you need to do is put back in the code from Task 1.

Nice work! :) :dizzy:

Dave Harker
PLUS
Dave Harker
Courses Plus Student 15,510 Points

Hi Robert Imlay,

I don't see any problems in your code.
When submitting the second challenge task did you remember to leave the code in there from task 1 ? According to the note added below the task requirements:

Important: In each task of this code challenge, the code you write should be added to the code from the previous task.

To confirm, I did a copy / paste of your code but leaving in task 1 above it and there are no issues, passed first time :)

Nice work! :dizzy:

Dave