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 trialVivian Cockhern
81 PointsDefining a string Variable that stores my name. What is wrong with the way I am enter my string Var
What am I doing wrong? I typed variable and when i go to run it the system does not except my code. ( String firstname = " Vivian";)
// I have setup a java.io.Console object for you named console
String firstname = "vivian";
11 Answers
Prem Yadav
7,346 PointsQ1. String firstName = "Vivian"; Q2. console.printf("<your Name> can code in java"); Q3. console.printf("%s can code in Java",firstName);
these are the answer of all three query which they asked... i hope now it will help you and if not let me know..:)
Prem Yadav
7,346 Points:) most welcome please mark it as best answer by clicking right side upper arrow. thank you.
Prem Yadav
7,346 PointsDear Vivian Cockhern You are doing great but remember whenever you defining variable you must write Access Specifiers of that variable. so your code would be like this
private String firstName = "vivian";
I hope this will help you
Vivian Cockhern
81 PointsOkay, Why was this not part of the lesson so i could have done it right the first time?
Vivian Cockhern
81 Pointsprivate String firstName = "vivian"; the system is still not excepting this. what am I doing wrong
Prem Yadav
7,346 Pointscan you please send your code....?
Vivian Cockhern
81 PointsHow do I send you my code?
Prem Yadav
7,346 Pointsjust copy your code and paste it in the comment only..:)
Vivian Cockhern
81 Pointsprivate String firstName = "vivian";
Prem Yadav
7,346 Pointsyou also did the same but i don't know why you are not getting error.
Prem Yadav
7,346 Points(why you are getting error)*
Vivian Cockhern
81 PointsThe answer you gave me was correct and the error message I got made no sense. Thanks for all your help, your the best!