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

Holden Cella
Holden Cella
1,176 Points

Why is this wrong...need help

I am trying to see what is wrong..

The previous question asked to print out the command <YOUR NAME> can write in java (or whatever it says.. this post is blocking the question). This question here is asking me to replace the name with a string formatter. and I have no idea why it is not compiling. Any help?

Name.java
// I have setup a java.io.Console object for you named console
String firstName = "Holden";
console.printf("%s can code in Java, firstName");

2 Answers

Rob Bridges
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 Points

Hello,

It looks like the way you are formatting your code.

It should look something like

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

Small error, but java is unfortuantely very picky.

Holden Cella
Holden Cella
1,176 Points

sure is. I noticed it after about 15 minutes of racking my brain. Thanks for the quick reply though!

Rob Bridges
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 Points

Pushing all the irritations beside, I guess it's for the best. Learning to work with java makes all the other programming language syntaxe make sense, at least it forces you to learn the principles.

Good luck with it! let me know if you need any help.

Holden Cella
Holden Cella
1,176 Points

Never mind, I put the quotations in the wrong place. I fixed it