This is a user-defined function required to execute a program. When you run your program in a compiled language, a function mainis what executes. For example, in Java, if you have a signature function public static void main(String ... args)in a class, then this class can be executed since the JVM will execute the contents of this method main.
An example in Java:
public class Test {
public static void main(String ... args) {
System.out.println("Hello World");
}
}
...
javac Test.java
...
java Test
Results in "Hello World" are printed on the console.
source
share