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 trialKieran Corcoran
11,188 PointsJava Basics
Hi,
Sorry, real beginner!
Can anyone tell me why this code is not correct? I am trying to combine variables.
var firstName = "Peter"; var lastName = "Smith"; var fullName = firstName + lastName;
3 Answers
Jack Choi
11,420 PointsMaybe it wants you to have a space between the first and last names?
var fullName = firstName + " " + lastName;
Edit: also Java and JavaScript are very different languages!
Valentin Berlin
14,346 PointsWhen you're saying it's not correct, how does this show?
Dave McFarland
Treehouse TeacherWhen something goes wrong in a code challenge make sure you look in the bar that appears directly above the area you type the code in. It turns red when there's a mistake and you can usually find an error message that can help you figure out what went wrong. For example, when I tried the code challenge using your code I got this message:
"Don't forget to add a space between your first and last name."
Also, watch the end of the first video again: Java is not JavaScript. They are two very different programming languages.
Kieran Corcoran
11,188 PointsHi Dave,
Thanks for the heads up. I saw the error but I clearly had brain freeze!
PS This is a brilliantly delivered course. Keep up the good work!!!
Dave McFarland
Treehouse TeacherThanks Kieran!
Kieran Corcoran
11,188 PointsKieran Corcoran
11,188 PointsHey,
Thank you for the quick responses, I was not adding the space. I could have been there a life time and not figured that out!
Thanks again.