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

name.java

i completely do know where to start to write

can some one help me!!!

do not know where to start to write

2 Answers

Anjali Pasupathy
Anjali Pasupathy
28,883 Points

The first task wants you to store a value of type String into a variable named firstName. The format for assigning a variable to a value in Java is as follows: TYPE NAME = VALUE;

In this case, the TYPE is String, the NAME is firstName, and the VALUE is some String literal containing your first name.

I hope this helps!

can you do example for me ?

can do it like this ( string = "My name" ; ) ?

Anjali Pasupathy
Anjali Pasupathy
28,883 Points

Not quite. You need to capitalize "string", and you need to give the name of the variable ("firstName") after the type:

String firstName = "My name";