Basic Java 'Hello World' Program:-
Every line of code that runs in Java must be inside a class.
In our example, we named the class Main.
Class name should always be same as filename.
Reason for this is that, when Java is compiled it generates a class file (a byte code)
which has same name as of class.
Now if filename and class name are different then it may lead to ambiguity.
The main() method is required and you will see it in every Java program
Inside the main() method, we can use the println() method to print a line of text to the screen
You don't have to understand the keywords before and after main.
You will get to know them bit by bit while reading this tutorial.
For now, just remember that every Java program has a class name which must match the filename,
and that every program must contain the main() method.
The curly braces {} marks the beginning and the end of a block of code.
Each code statement must end with a semicolon.
Java Comments
Comments can be used to explain Java code, and to make it more readable.
It can also be used to prevent execution when testing alternative code.
Single-line comments start with two forward slashes (//).
Multi-line comments start with /* and ends with */.
Any text between // and the end of the line or /* and */ is ignored by Java (will not be executed).