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 trialMichael Noble
Courses Plus Student 215 PointsAm I adding too much?
What did I do wrong?
// I have imported a java.io.Console for you, it is named console.
String firstExample = console.readLine("hello");
String secondExample = console.readLine("hello");
String thirdExample = console.readLine("HELLO");
if (firstExample.equals(secondExample)) {
console.printf("%s", thirdExample);
2 Answers
jacksonpranica
17,610 PointsHey Michael,
First off, you're printing off the variable thirdExample when the challenge tells you what string you should be printing. So read the challenge description and look what you're suppose to be printing.
Secondly make sure to close your if statement with "}"
Michael Noble
Courses Plus Student 215 PointsOh, ok I see. I was kinda jumping the gun a bit huh? Thank you very much for your help.
jacksonpranica
17,610 PointsNo problem Michael! Hopefully that cleared things up. If it didn't I apologize.
Michael Noble
Courses Plus Student 215 PointsMichael Noble
Courses Plus Student 215 PointsI'm very new to this, can you break that done a little more. I went back and added the missing bracket but I'm still getting errors. I even changed my "printf" statement. I'm really lost..
jacksonpranica
17,610 Pointsjacksonpranica
17,610 PointsHey Michael,
Don't worry about being new, I should have done a better job breaking it down from the start.
Here is what I mean. Your if statement is wonderful. You did everything correctly. the problem is whats being printed.
It says in the description to print out "first is equal to second", so that is what you need to be printing in the printf statement like above.
Try to use this as a base to finish the challenge with the second if statement