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 (by choosing File, Save or the Save All Files button).

Listing 2.2. The Finished Version of the Saluton Program


 1: class Saluton {
 2:     public static void main(String[] args) {
 3:         String greeting = "Saluton mondo!";
 4:         System.out.println(greeting);
 5:     }
 6: }


When the computer runs this program, it runs 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 of Java.

Listing 2.3. A Line-by-Line Breakdown of the Saluton Program


 1: The Saluton program begins here:
 2:     The main part of the program begins here:
 3:         Store the text "Saluton mondo!" in a String variable named
greeting
 4:         Display the contents of the variable greeting
 5:     The main part of the program ends here.
 6: The Saluton program ends here.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.111.179