5-2 LoopCall

Post date: Mar 8, 2014 5:28:58 PM

//This program defines and call a simple method.

package loopcall;

public class LoopCall 

{

        public static void main(String[] args)

        {

            System.out.println("Hello from the main nethod.");

            for (int i=0;i < 5; i++)

                displaymessage();

            System.out.println("Back in the main method.");

        }

        //The displaymessage method displays a greeting.

        public static void displaymessage()

        {

            System.out.println("Hello from the displaymessage method.");

        }

    

}