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

can't find symbol error

when i try to run the program it gives me an error can't find symbol for printf. I've tried it a couple times. What am I doing wrong?

Name.java
// I have setup a java.io.Console object for you named conso
printf("hello my name is mike");

2 Answers

Sean McKeown
Sean McKeown
23,267 Points

Try this:

System.out.println("hello my name is mike");

I think you use printf if there is a variable you need to add to your string.

Craig Dennis
Craig Dennis
Treehouse Teacher

Thanks Sean, haven't quite gotten to System.out yet in this specific course.

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

You forgot console. console.printf