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 IO

Ishana Saripalli
Ishana Saripalli
212 Points

I don't understand how there is a syntax error here

There is something wrong with the third line of code

IO.java
String firstName = console.readLine("Ishana");
String lastName = console.readLine("Saripalli");
String firstName = console.pf("First name: %s");

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

Hey Ishana Saripalli, you are very close!

Three items need changing:

• the method to call is printf instead of “of” • the method requires two arguments: a format string and a variable to use for populating %s • the method call output should not be assigned to a variable

Post back if you need more help. Good luck!!!