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 trialDerek Williams
522 PointsI believe I am doing this right by using... if (firstExample.equals(secondExample)) { ... but it is saying try again.
I feel I am doing this right but it keeps telling me to try again. Maybe I am missing a character somewhere but I have checked to see. It's not showing a compiler error but just telling me to try again.
// 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");
System.exit(0);
}
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHi Derek,
You do have the correct code, but you also have code that the challenge did not ask for. If you just delete the extra line of code System.exit(0);
, the task will pass.
Note to Remember: Challenges are very strict and instruction need to be followed explicitly. A very good rule to follow: If the instructions don't ask you to do something... don't.
Nice work! :)
Jonathan Hermansen
25,935 PointsJonathan Hermansen
25,935 PointsNo need to include "System.exit(0)"