Hello World Program
In this page we learn how to write simple Java program and display "Hello World"on screen.
Public Static Void main(Stringargs)
Output of program on command prompt:
- Class Test:-The first statement of our code is Class Test.Since JAVA is Object oriented language and every program in Java contain atleast one class.Whatever we write must appear within opening and closing braces of class.
- main:-The second statement is main method. In Java like (C/C++)entry point for execution of program is methodmain which is called by JVM.
- Public:-Is an access modifier and in OOPS any method or variable which is declared public can be accessible outside of that class.Since main is public,JVM can easily accessed and execute it.
- Static:-Static methods can be call without any object,simply using class name.
- Void:-keyword Void is return type which indicates that no value returned by method(main)to its caller(JVM)
- Stringargs:-is called Command Line arguement,where String is predefined class.