In Java, the entry point to the program is a function called main. It has the following syntax:
So, now what does each of this mean? We don't need to go into details, but at a high level:
public - This function/method is available for Operating system to see
static - We don't need an "instance" of this class. Don't get it? It's okay, we'll visit this later
void - This method returns nothing
String args - This is basically a String array. You can optionally pass some arguments in an array.
Now, if we want to print a line, the syntax is:
Now, putting this all together, here is the full program.
That's it, folks!
You have your first Java program done. Congrats!!