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

Define a string variable firstname and store your name and set the value to your name ??

how to solve this problem

Name.java
class ABC
{
   void main()
  {
    String firstName ="Anish";
    System.out.println("my name is"+firstName);
  }
}

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

First off, you're doing great! The problem is that you're going way above and beyond what they're actually asking for. They're going to set up main for you and any classes you need. Later on down the road they'll ask you to implement classes yourself. Your knowledge is beyond what they're expecting at this particular point :smile: This is the single line you need for step 1:

String firstName ="Anish";

Happy coding!

Thank you :-)