2. HELLO WORLD PROGRAM IN JAVA
Hello people, To take your baby steps in java programming, knowing the fundamentals is unskippable. In
this article, we will learn the foundation program in Java. If you consider any programming language, the
Hello World program is a popular one to start learning. So, let us begin with Java hello World Program.
PREREQUISITES OF JAVA PROGRAMMING:
Install JDK(Java Development Kit)
Set environment variables
The requirements are listed below:
Now you are good to go.
3. BASIC STEPS IN JAVA PROGRAMMING:
Let us look into some basic steps in Java programming:
1. Write your program in a text editor and save the file as filename.java.
2. Open the command prompt and use the following command to compile it.
javac filename.java
3. To run the program, use the command given below.
Java filename.java
You can also use IDE to compile, run and debug the java programs. The Integrated Development
Environment(IDE) is the one-stop shop for all your programming needs. It consists of a text editor, compiler,
debugger, runner, and other essential tools with Graphical User Interface. Some popular IDEs for Java are
Eclipse, Netbeans, IntelliJIDEA, etc.
4. INTERNAL PROCESS IN JAVA PROGRAMMING:
Java Development Kit(JDK) is the development environment for developing applications or
software in Java. It comprises Java Runtime Environment(JRE), interpreter/loader,
documentation generator, compiler, archiver, and other development tools.
Java Runtime Environment(JRE) is an environment that runs the Java program. It comprises a
Java Virtual Machine(JVM) and a set of library files.
JVM is a runtime interpreter that helps in the line-by-line execution of Java programs. It
comprises the class loader, bytecode verifier, JIT compiler, and interpreter.
5.
6. Now let us begin to know the internal process in Java programming.
1. You will develop your program files using a text editor or IDE.
2. When you compile the program, the compiler in JDK converts the source program into a
bytecode or class file.
3. When you run the program, It enters the Java Runtime Environment. Now the JVM takes
charge and uses the
4. class loader to load the main class and all the necessary classes.
5. Then the Bytecode verifier verifies the bytecode for any misleading instructions or illegitimate
code.
6. Now the Jit compiler converts the bytecode to machine code at runtime.
7. The interpreter uses machine code to execute the program.
8. Finally, JRE executes the program successfully.
7.
8. SUMMARY
We have taken baby steps into the java programming world by learning the basics. I hope you
gained some knowledge. Consistent practice is needed to master coding skills. So no more
delay, fold your sleeves and start working.