Let us write our first Application which just prints 'Hello World' on the screen.
1. In the above code we are printing 'Hello World' using the below statement :
We do not have to dig much into individual component in the output statement for now. We can just remember, System.out.println() is the statement used to print something on the screen
2. Since, java is said to be a complete object oriented programming language(Except primitives). All java programmes should be written inside a class. 'FirstApplication' is the name of the class inside which we have to write our code :
3. Inside the class 'FirstApplication', we have the main() method. The main() method is the entry point of a standalone java application. So, java executes the code written inside the main() method :
Since, System.out.println("Hello World") is inside the main() method, it got printed.
We have to write all our codes inside the main method. And the main method should be inside a class.