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 trialHerbert Keijman
702 PointsWhat's wrong with this code?
I checked the make sure advice but it's still not working
// 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");
}
Herbert Keijman
702 PointsI think using System.out.println is correct but in this course they use console.printf
1 Answer
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsYour task 2 of challenge is correct, however you have to leave the first task done as well:
Please add to your code solution of the first task
"Add an if statement that checks to see if firstExample is equal to secondExample. If it is, print out "first is equal to second".
Herbert Keijman
702 PointsThanks!
Tomas Schlepers
18,039 PointsTomas Schlepers
18,039 PointsI think the problem is with the console.printf command.
In Java, to print something to the console, I usually use System.out.println
I think console.printf is a combination between JavaScript (console) and Java (printf). Let me know if this was the fix :)