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

Java Beginner here

I am not sure what to do I am a beginner to Java
// I have setup a object for you named console
String firstName = "Justin";
console.printf("%s\n", firstName);

2 Answers

Tonnie Fanadez
Tonnie Fanadez
UX Design Techdegree Graduate 20,657 Points

Hi Justin Townsend

Welcome to Java, it is my favorite language and we're all here to help you out. I can see you got the first part of the challenge spot on - see you're doing a fantastic job.

From your above code you just forgot to write "can code in Java!" . Write this and you will pass the challenge

String firstName = "Justin";
console.printf("%s can code in Java!", firstName);

hope this helps

It really did thank you for those encouraging words! and your help!

Sean M
Sean M
Treehouse Moderator 7,327 Points
console.printf("%s is your name", firstName);

Means to insert your name (firstName) where %s is located.