A Simple Java Program

Below is the Java Program which Prints Selenium--By-Arun text as output:


        class Simple
        {
                   public static void main(String args[])
                   {
                         System.out.println("Selenium-By-Arun");
                   }
        }

Lets understand the above Java Program by identifying the terminology used in it.

On high level, the above program has main method inside the class Simple 
  1. class is used to declare a class in java. (Will explain the concept of class in depth in upcoming posts)
  2. public means visible to all. (Will explain the concept of public in depth in upcoming posts)
  3. static If any method is declared as static, then the method is called as static method. If the method is declared as static, then there is no need of creating object to invoke the main method (Will explain the concept of static and objects in depth in upcoming posts)
  4. main represents the start of the program. The program execution starts from main method. (Will explain the concept of methods in depth in upcoming posts)
  5. String args[] is used for command line argument (Will explain this in the later posts)
  6. System.out.println() is used to print statements.