You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/docs/hello-world.mdx
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -32,11 +32,11 @@ Hello, World!
32
32
33
33
## How Java "Hello, World!" Program Works?
34
34
35
-
####1. Your First Program
35
+
### 1. Your First Program
36
36
37
37
In Java, any line starting with `//` is a comment. Comments are intended for users reading the code to understand the intent and functionality of the program. It is completely ignored by the Java compiler (an application that translates Java program to Java bytecode that computer can execute). To learn more, visit [Java comments](/comments).
38
38
39
-
####2. class HelloWorld
39
+
### 2. class HelloWorld
40
40
41
41
In Java, every application begins with a class definition. In the program, HelloWorld is the name of the class, and the class definition is:
42
42
@@ -49,7 +49,7 @@ class HelloWorld {
49
49
50
50
For now, just remember that every Java application has a class definition, and the name of the class should match the filename in Java.
51
51
52
-
####3. public static void main(String[] args)
52
+
### 3. public static void main(String[] args)
53
53
54
54
This is the main method. Every application in Java must contain the main method. The Java compiler starts executing the code from the main method.
55
55
@@ -63,7 +63,7 @@ public static void main(String[] args) {
63
63
}
64
64
```
65
65
66
-
####4. System.out.println("Hello, World!");
66
+
### 4. System.out.println("Hello, World!");
67
67
68
68
The code above is a print statement. It prints the text `Hello, World!` to standard output (your screen). The text inside the quotation marks is called String in Java.
0 commit comments