Card 02/ 06
All 6 cards
ExampleDifficulty: Beginner1 min
One Command Writes a File, the Other Reads It
A folder with one file in it, and two commands that take it from text to output. What appears on disk between them is the whole story.
$ ls
Hello.java
$ javac Hello.java
$ ls
Hello.class Hello.javajavac is the first translation. It read the text, checked it, and wrote Hello.class — the bytecode. Silence means it worked; a compiler that has nothing to complain about says nothing.
$ java Hello
Hellojava is the second translation. Notice what it was given: Hello, with no extension and no .class on the end. It takes the name of a class, not the name of a file, and then goes looking for the bytecode that carries it.
That is the pair you will type for the rest of your life, under one build tool or another: one command that produces bytecode and one that runs it.