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

please help me in this

how to start

Name.java
// I have setup a java.io.Console object for you named console
string.firstNmame="yogi";
console.printf("hiiiiiii this is yogi %s"fisrtName);

1 Answer

It should be like this

/String declaration was incorrect, keyword is String with s capital. Space in between variable name and keyword for example String firstName/

String firstName = "Yogi";

/console.printf("hiiiiiii this is yogi %s"fisrtName); should be like this/

console.printf("hiiiiiii this is %s", firsttName); (If you are solving a challenge, print exactly the same statement what task is asking for for example console.printf("%s can code in Java", firstName);)

/Additional Note: : In your challenge you need to use console.printf(). It is because we are invoking console applications otherwise you may also use System.out.printf(""hiiiiiii this is %s", firsttName); . This will not need you to import java.io.Console and instantiate it for example Console console = System.console();)/

Let me know if that helps, Thanks !

-Gaurav