5-2 LoopCall

posted Mar 8, 2014, 9:28 AM by Dlovan ismail   [ updated Mar 8, 2014, 9:34 AM by Karwan Jacksi ]
//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.");
        }
    
}

ċ
LoopCall.java
(1k)
Karwan Jacksi,
Mar 8, 2014, 9:28 AM
Comments