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

Justin Townsend
Justin Townsend
3,856 Points

Java Beginner here

I am not sure what to do I am a beginner to Java

Name.java
// I have setup a java.io.Console object for you named console
String firstName = "Justin";
console.printf("%s\n", firstName);

2 Answers

Tonnie Fanadez
Tonnie Fanadez
UX Design Techdegree Student 13,604 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

Justin Townsend
Justin Townsend
3,856 Points

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

Sean M
MOD
Sean M
Treehouse Moderator 6,434 Points
console.printf("%s is your name", firstName);

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