/* * File: Greeter.java * Author: Java, Java, Java * Description: This application program illustrates the use of the * println() output method. * When run, the program will print the greeting "My name is Joe". */ public class Greeter extends Object // Class header { // Start of class body private String greeting = "My name is Joe"; // Instance variable public void printGreeting() // Method definition header { // Start of method body System.out.println(greeting); // Output statement } // printGreeting() // End of method body public static void main(String args[]) // Method definition header { // Start of method body Greeter greeter; // Reference variable declaration greeter = new Greeter(); // Object instantiation statement greeter.printGreeting(); // Method call } // main() // End of method body } // Greeter