go to previous page   go to home page   go to next page highlighting

Answer:

The source file contained a syntax error (in this case a missing ") and could not be compiled.

Notice that the compiler says there are "3 errors" even though there is really only one. This is common. Sometimes when there is a syntax error the compiler gets confused and prints messages that are misleading.

Find the first error, use the text editor to correct the program, save it (to the same filename) and compile again.


Running the Program

The next chapter will discuss syntax further and show more details.

To run the program, do this:

Hello World!

The program prints out Hello World!

The command java Hello starts up the Java Virtual Machine with the bytecode file Hello.class.

Aggravations: don't use the extension class with the file name. Also, the command is java without a "c" at the end.


QUESTION 8:

(Review: ) Could Hello.class be sent to a printer?


go to previous page   go to home page   go to next page