Chapter 01 of 77

Introduction to Java

If you are completely new to programming, you may have heard the name Java many times. Java is one of the most popular programming languages and has been used to build all kinds of software, from large business applications to mobile and web applications.

But before we start learning Java syntax, let's first understand what Java actually is and why people use it.

What is Java?

Java is a high-level, general-purpose programming language.

In simple words, Java is a language that allows us to give instructions to a computer in a way that is easier for humans to understand.

For example, we can write:

System.out.println("Hello World!");

This tells the computer to display:

Hello World!

Of course, Java is capable of doing much more than printing text. We can use it to build complete applications and solve complex problems.

Who Created Java?

Java was developed at Sun Microsystems by a team led by James Gosling.

The language was originally called Oak, but later it was renamed Java.

Java was officially released in 1995.

Since then, Java has gone through many improvements and has become a major programming language used around the world.

Why Was Java Created?

Java was designed to make it easier to develop software that could work across different types of computers and operating systems.

At the time, developers often had to consider the specific hardware and operating system their software was going to run on.

Java was designed with the idea that developers should be able to write their program without having to completely rewrite it for every platform.

This idea became strongly associated with Java through the phrase:

Write Once, Run Anywhere.

The goal was simple: make Java applications more portable across different platforms.

Where is Java Used?

Java is used in many different areas of software development.

For example, Java is commonly used for:

  • Backend applications

  • Enterprise software

  • Banking systems

  • Web applications

  • Android applications

  • Cloud-based applications

  • Large-scale business systems

You may not always see Java directly as a user, but it is often working behind the scenes in many large software systems.

Java has been around for a long time, but that doesn't mean it is an outdated language.

One major reason Java remains popular is its huge ecosystem. There are many libraries, frameworks, development tools, and learning resources available for Java.

Java is also widely used by companies for large applications because it is designed to support applications that need to be maintained and expanded for many years.

Another reason is that Java teaches many important programming concepts very well. Concepts such as object-oriented programming, data structures, and exception handling are useful far beyond Java itself.

Java is More Than Just a Language

When you learn Java, you are not simply learning how to write Java syntax.

You are also learning how programmers think about solving problems.

For example, instead of manually solving the same task again and again, you can write a program that performs the task automatically.

This is the real purpose of programming: using instructions to make a computer solve problems for us.

Java is simply one of the tools we can use to do that.

How Does Java Run? (JDK, JRE and JVM)

Java achieves "Write Once, Run Anywhere" with a two-step process:

  1. The Java compiler (javac) converts your source code (a .java file) into bytecode (a .class file). Bytecode is not tied to any particular processor or operating system.

  2. The Java Virtual Machine (JVM) runs that bytecode. Each operating system has its own JVM, so the same .class file can run on Windows, macOS, or Linux.

Main.java  --javac-->  Main.class (bytecode)  --JVM-->  Output

You will often hear three terms:

Term

What it is

JVM (Java Virtual Machine)

Runs Java bytecode. It also manages memory automatically using garbage collection.

JRE (Java Runtime Environment)

The JVM plus the standard libraries needed to run Java programs.

JDK (Java Development Kit)

Everything in the JRE plus development tools such as the compiler javac. You need the JDK to write and compile Java programs.

A simple way to remember it: JDK = JRE + development tools, and JRE = JVM + libraries. (Since Java 11, Oracle no longer provides a separate JRE download, so in practice you simply install a JDK.)

Java Versions

Since 2017, a new Java version is released every six months, in March and September. Some versions are marked as LTS (Long-Term Support) and receive updates for many years, so companies mostly use those. Well-known LTS versions are Java 8, 11, 17, 21 and Java 25 (released in September 2025), which is the latest LTS at the time of writing. Java 27 (September 2026) is the newest release, but it is not an LTS. Everything in this tutorial works on Java 17 or later unless a chapter says otherwise.

A Simple Java Example

Here is a very simple Java statement:

System.out.println("Welcome to Java!");

It prints:

Welcome to Java!

Don't worry if you don't understand every part of this statement yet. We will learn the Java syntax step by step throughout this course.

For now, the important thing is to understand what Java is and why it is used.