Journey into Java: From “Hello, World!” to
the Java Development Kit

Journey into Java: From “Hello, World!” to the Java Development Kit

Java is one of the most popular high-level languages in the world. It is based on the principle of “Write once, run anywhere”. In this blog post, we will walk you through the basics of a basic Java program and give you a deep dive into the Java development kit (JDK).

The “Hello, World!” Program in Java

Let's begin with the all-time classic "Hello, World!" program:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

This simple program comprises several components:

  1. Public class: public class HelloWorld declares a public class named HelloWorld. In Java, every application must contain a main class that wraps around the program.

  2. Main method: public static void main(String[] args) is the main method where the JVM starts running the program. The keyword public is an access modifier that allows other classes to execute this method. static allows the method to run without having to instantiate the class object. void means the method doesn’t return any value.

  3. System.out.println: System.out.println("Hello, World!"); prints the string “Hello, World!” to th console. System is a built-in class, out is an instance of the PrintStream class, and println is a method of PrintStream.

Java Development Kit (JDK)

The JDK (Java Development Kit) is the software development environment used to create Java applications. The JDK includes the JRE (Java Runtime Environment), the JVM (Java Interpreter/Loader), the JAVAC (Javac compiler), the JAVA (JAVA Archiver) (jar), the JAVADOC (JAVADOC documentation generator), and other tools used in Java development.

Components of JDK

  1. Java Compiler (javac): This tool reads Java language source code (.java files) and translates it into Java bytecode (.class files).

  2. Java Interpreter (java): The interpreter reads and executes the Java bytecode on the Java Virtual Machine (JVM).

  3. Java Archiver (jar): This tool packages related class libraries into a single JAR file. This file is platform-independent and can be used to distribute an application.

  4. Javadoc: This tool generates API documentation in HTML format from Java source code.

  5. JDB (Java Debugger): This tool helps in finding and fixing bugs in Java program source code.

  6. JRE (Java Runtime Environment): It provides the libraries, Java Virtual Machine (JVM), and other components necessary to run Java applications and applets.

JDK Diagram

In the diagram above, the Java compiler (javac) compiles your code into bytecode. The Java Virtual Machine (JVM) then interprets this bytecode, making it possible to run the Java program.

Conclusion

Java is a powerful programming language with a powerful Java Development Kit (JDK) and the easy-to-use "Hello, World!" program. Developing and running programs in Java is a breeze. Learning the basics of Java programming is just the first step. As you learn more about Java programming, you will learn more about its tools and features . Java is a versatile programming language that can be used to develop and run a variety of computing applications.

In this blog post, you will learn everything you need to know about Java programming. But don't worry, this is just the start of your journey in Java. Keep coding, keep learning, and most of all, have fun coding!