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 trial

Java Java Basics Getting Started with Java Strings, Variables, and Formatting

Defining 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";)

Name.java
// I have setup a java.io.Console object for you named console

String firstname = "vivian";

11 Answers

Q1. 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..:)

:) most welcome please mark it as best answer by clicking right side upper arrow. thank you.

Dear 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

Okay, Why was this not part of the lesson so i could have done it right the first time?

private String firstName = "vivian"; the system is still not excepting this. what am I doing wrong

can you please send your code....?

How do I send you my code?

just copy your code and paste it in the comment only..:)

private String firstName = "vivian";

you also did the same but i don't know why you are not getting error.

(why you are getting error)*

The answer you gave me was correct and the error message I got made no sense. Thanks for all your help, your the best!