Let’s start with the first Program to Print Hello world in Java.
A basic program Hello world in Java, that displays “Hello, World!”. It’s mostly used to illustrate the syntax of the language.
Print Hello world in Java
To understand this example, you should have the knowledge of following Java programming topics:
public static void main(String args)
In the above program, we have used here built-in System.out.println() method to print the string Hello, world!on our screen.
Where System is a class , out is object reference and println() is method ,together they responsible to print anything on console ,
i.e anything which is given in double quotes will be printed on the console screen , but unlike printf() function of C Programming Language , something is special about this method.
If you run the above code , you will be surprised by the automatic generated new line because the method println() in Java generates new line after printing something on console which is pretty good for us.
Since in C Programming language we specifically need to put backslash n (‘\n’) in order to generate a new line
Ask your questions and clarify your/others doubts by commenting. Documentation