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!
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
SUDIPTA BOSE201 Points
can you explain why i have to use console.printf instead of system.out.println?
well,i saw a hello world program in a book where they used system.out.println instead of console.printf.so i am really confused about this matter.
I also had this problem when I first watched this video. I stumbled upon this answer here to clear things up: https://teamtreehouse.com/community/what-is-the-difference-between-systemoutprint-and-consoleprintf
J Tan11,847 Points
Craig Dennis explains some differences here: https://teamtreehouse.com/community/is-consoleprintf-good-practice
I think most books use
System.out.println because it can be used universally across different applications. Say if you're building an web app using Spring, you can use System.out to print outputs for your debugging.