From fac44bad309a3e8a0b913480d8a834227a2dfc49 Mon Sep 17 00:00:00 2001 From: nishantsharma09 <31575597+nishantsharma09@users.noreply.github.com> Date: Thu, 15 Oct 2020 23:04:55 +0530 Subject: [PATCH] I have added some explanation to it --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index f0afe37..2c7a61b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,21 @@ # Java-Program Hello World +class HelloWorld +{ + // Your program begins with a call to main(). + // Prints "Hello, World" to the terminal window. + public static void main(String args[]) + { + System.out.println("Hello, World"); + } +} +explanation +public static void main(String[] args) + +public: So that JVM can execute the method from anywhere. +static: Main method is to be called without object. +The modifiers public and static can be written in either order. +void: The main method doesn't return anything. +main(): Name configured in the JVM. +String[]: The main method accepts a single argument: + an array of elements of type String.