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 Using your New Tools Coding the Prototype

I don't understand what this means.

In the console we write

treehouse:~/workspace$ clear && javac TreeStory.java && java TreeStory^C

Can someone give a step-by-step instructions toward what everything means and why it's in the sentence? Also, is there an alternative to that line of code? Can someone refresh my memory on what is does also? -Thanks!

1 Answer

Steven Parker
Steven Parker
231,275 Points

There's 3 separate commands here, let's break it down:

clear :point_left: Clear the screen
javac TreeStory.java :point_left: Compile the program in the source file "TreeStory.java"
java TreeStory :point_left: Run the compiled program

The double ampersands ("&&") separate multiple commands on the same line, plus they mean "if the command on the left was successful, continue to the right". So if any command fails, nothing else on the line will be done.

The obvious alternative is to type each command in separately and wait for it to finish before going on.