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 Receiving Input

Why do we NOT need "ls" (list) in the terminal for the readline method, but we do for the printf ?

Question is basically the title

1 Answer

Do not confuse commands that occur in the terminal and within the .java file; they are 2 different environments.

To answer your question in short, you do not need to type "ls" when running either method. "ls" is a way to show all the different files and directories where you are currently. Think of it when you open Explorer (in PC) or Finder (in Mac), when you open a folder, it automatically is calling "ls" for you and showing all the files/folders that live in the directory that you just clicked.