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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Evan McPheron](https://secure.gravatar.com/avatar/a614371e9eae38497cc049a4fe2c0b53?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Evan McPheron
106 PointsWhy Console.printf() and not System.out.println()
So I know the output for both methods seem to be essentially the same but is there a reason that you’re using one that require an input statement instead of System.out.println()
If they aren’t the same what would be your reasoning for using one over the other?
2 Answers
![Tsenko Aleksiev](https://uploads.teamtreehouse.com/production/profile-photos/6256972/micro_me.jpg)
Tsenko Aleksiev
3,819 Points.println() - it print the entered String and goes to the next line after finished printing .printf() - it prints formatted text. The easiest to explain is ("%s is learning to code", myNameVar ). printF() uses those kind of place holders, which are replaced with your variables AND it doesn't goes to new line after finished printing.
![Ashield Smith](https://secure.gravatar.com/avatar/bcbaa9920d138c495b7dfd1abdce7e2e?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ashield Smith
3,300 PointsI hope this helps:
// setting our Object/String as foodCravings = pizza
Object foodCravings = "pizza";
//to call upon that object, we can use %s(for string/object), helpful for when you want to store values & call upon that object frequently
console.printf("I want some %s\n",foodCravings);
// here, we are forced to type out "pizza" as opposed to just calling upon it w/ the printf method
System.out.println("I want some pizza");
// we are using that println method again, but instead of typing pizza, we added our object from earlier. take note of the plus sign directly following the closed parenthesis
System.out.println("I want some " + foodCravings);