Saving the Finished Product

Your program should now resemble Listing 2.2, although you might have used slightly different spacing in Lines 3–4. Make any corrections that are needed and save the file as Saluton.java. Keep in mind that all Java programs are created as textfiles and are saved with the .java file extension.

Listing 2.2. The Finished Version of the Saluton Program
1: class Saluton {
2:     public static void main(String[] arguments) {
3:         String greeting = "Saluton mondo!";
4:         System.out.println(greeting);
5:     }
6: }

When the computer runs this program, it will run each of the statements in the main statement block on Lines 3 and 4. Listing 2.3 shows what the program would look like if it were written in the English language instead ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.