The phrase “hello, world” is much more than a pretty script animation whenever you got a new Apple product. There is a reason behind why they brings it up every time they start something new.
Being able to run a “hello, world” program in Java script doesn’t necessarily start the whole programming industry, but its practice. It’s typically the first program taught in beginner programming courses and tutorials.
“Hello, world” is the ability of starting working on something impactful, coding.
It’s about a story of anyone who decided to code wired machines and historically changed everything we knew. illustration by anh nguyen
As it traced back to the humble origins, “hello world” program holds significance in helping us always remeber that first hopeful, scary yet exciting feeling. When it all begins (ideally it being something we love doing). Before you get all goosebumps of my cheese words, let’s get to our lesson!
“hello, world”
anh’s note from reading “Hello, World!” program by Wikipedia and Java Hello World Program by Geeks For Geeks:
Hello, World! program is a simple computer program that outputs “Hello, World!” to the screen, often used to illustrate a language’s basic syntax.
- Typically the first program written by students learning a new programming language.
- Serves as a sanity check to ensure that the software environment for compiling and running code is correctly set up.
History:
- Originated from a C programming example in the 1978 book “The C Programming Language” by Brian Kernighan and Dennis Ritchie.
- Earlier roots possibly influenced by examples in BCPL and Bell Laboratories memoranda.
- A tradition in programming language education and is used across various languages and platforms.

Variations:
- Vary in complexity between languages, from single statements to more involved setups.
- Some languages have different versions of the phrase or use alternative greetings.
- Functional programming languages may use a factorial program instead.
- Embedded systems may substitute “Hello, World!” with a blinking LED.
Time to Hello World (TTHW):
- A measure of a programming language’s ease of use, indicating the time it takes to write a “Hello, World!” program.
- Shorter TTHW suggests a more approachable language.
step-by-step
1. Creating the program: Write the program using a text editor or IDE.
- Choose a text editor or an Integrated Development Environment (IDE) like Eclipse, IntelliJ IDEA, or NetBeans to write your Java code.
- Write the Java code for the “Hello, World!” program. This involves creating a class with a main method that prints “Hello, World!” to the console.
- Save the Java file with a .java extension. The filename should match the class name exactly, including capitalization.
2. Compiling the program: Use the Java compiler (javac) to create a bytecode file.
- Open a terminal or command prompt.
- Navigate to the directory where your Java file is saved.
- Use the Java compiler (javac) to compile the Java source code into bytecode
javac HelloWorld.java
- If there are no syntax errors, this command will generate a bytecode file named HelloWorld.class in the same directory.
3. Running the program: Execute the bytecode file using the Java interpreter (java).
- After successful compilation, run the Java program using the Java interpreter (java).
- In the terminal or command prompt, execute the following command
java HelloWorld
- This command runs the bytecode file generated earlier. If everything is correct, it will output “Hello, World!” to the console.
4. Example Java “Hello, World!” program:
- The example program defines a class named “HelloWorld”.
- Inside the class, there is a main method, which serves as the entry point for the program.
- The main method contains a single line of code:
System.out.println("Hello, World");
- This line uses the method to print the string “Hello, World” to the console.
5. Important Points:
- The class name (“HelloWorld”) matches the filename (“HelloWorld.java”).
- The main method must be declared as public, static, and void.
- Comments in Java can be single-line (//) or multiline (/* */), as demonstrated in the example.
- Java programs must be compiled before they can be executed:
feeling inspired? hopes and dreams?

Now you know. Start coding! Embrace something new everyday, you won’t regret it 🙂


Leave a Reply