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

Joey Feldhaus
Joey Feldhaus
2,220 Points

Icant see what im missing here

I've watched the video a few times now, and haven't caught what I'm missing

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

1 Answer

Lucas Smith
Lucas Smith
11,616 Points

Hi there!

It looks like the printf method call isn't being made on the console object. In order to call a method on an object, it needs to be connected by a ., otherwise the compiler will see them as two different things, and not know what to do! To call printf on **console, it should look like this:

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

I hope this helps and makes sense! Happy coding!