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 trialPratham Patel
4,976 PointsI need help with a java basics code challenge
I keep getting a compiler error saying cannot find symbol
// I have imported a java.io.Console for you, it is named console.
String firstExample = "hello";
String secondExample = "hello";
String thirdExample = "HELLO";
if (firstExample.equals(secondExample));
{
console.printf("first is equal to second");
}
if (firstExample.equalsIgnoringCase(thirdExample));
{
console.printf("first and third are the same ignoring case");
}
2 Answers
Jason Anders
Treehouse Moderator 145,860 PointsHey Rakesh,
You've almost got it. It's just a naming error for the method. The method is named with ignore
not ignoring
. So, what you need is,
if (firstExample.equalsIgnoreCase(thirdExample));
Other than that... good job and keep coding! :)
Simon Coates
28,694 PointsIt's trying to tell you it doesn't recognize the method. The method should be equalsIgnoreCase. It's worth remembering that particular message, since it seems to show up a lot during the java challenges (no autocomplete or error highlighting to catch trivial errors). If in doubt about a standard java method, consult the online API.