|
Answer» The entry POINT for any Java code is called main() and is always written as a public static VOID main (String[] ARGS). - public: The term "public" REFERS to an access modifier. It's used to specify who has access to use this method. This method is public, which implies that it can be accessed by any class.
- static: This is a keyword that indicates that it is a class-based system. In Java, main() is made static so that it can be accessed without having to create a class instance; however if main is not made static, the compiler will throw an error because main() is called by the JVM before any objects are created, and only static methods can be directly invoked via the class.
- void: The return type of a method is void, and it defines a method that does not return any value.
- main: It's the name of the method that JVM looks for when it's searching for a starting point for an application with a specific signature, and it's the method where the main execution happens.
- String args[]: The parameter passed to the main method is String args[]. args[] is an array of arguments with each ELEMENT as a string.
|