A simple program


public class SimpleProgram
{
        public static void main(String[] args)
        {
                System.out.println("Programming World");
        }
}


        This example shows how to print a string on the screen. This is a very simple program and it uses a method println() to print the texts given inside its braces. This example has only one method main method. This method is the entry point for any program so this means that when we start any program in java it start from the main method. But it must be given importance that the main method is written inside a class named as SimpleProgram because java does not permit to define a method outside a class unlike C++.

0 comments:

Post a Comment