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 trialMoses Mobegi
Android Development Techdegree Student 490 PointsHow do I define a String named firstName correctly? I am having a difficult time with this particular coding exercise
I'm not sure what I am doing wrong, but I wrote out the String = firstName "" and added my name between the quotes and somehow did the exercise wrong.
Console console = System.console();
String firstName = "Moses";
2 Answers
Alexander Davison
65,469 PointsThere's no need for the first line of code. You should have this as your code:
String firstName = "Moses";
Hope this helps, ~Alex
Izhar Ashraf
762 Points// I have setup a java.io.Console object for you name Public class Name{ Public static void main(String[]args) { Console console = System.console(); String firstName = "Moses"; console.printf(Name); } } why this program giving errors any idea
Moses Mobegi
Android Development Techdegree Student 490 PointsMoses Mobegi
Android Development Techdegree Student 490 PointsYes it did, Thank you Alex!
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsCan you give me a "best answer" so this question won't be in the "Unanswered questions" section of the Community?
Thanks, Alex