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

Equality challenge issues?

So the error message is telling me to make sure i put .equalsIgnoreCase and console.printf. I've looked over my code and the only thing i changed since the previous part of the change is from .equals to .equalsIgnoreCase. Please help!

Equality.java
// I have imported a java.io.Console for you, it is named console. 
String firstExample = ("hello");
String secondExample = ("hello");
String thirdExample = ("HELLO");
if (firstExample.equalsIgnoreCase(thirdExample))  { 
  console.printf("First and third are the same ignoring case");
}

1 Answer

Seth Kroger
Seth Kroger
56,414 Points

The instructions may not cover this point but the challenge answers are supposed to be cumulative. You just need to leave the code for the first step of the challenge there are add a new if statement for the second step.