Java - Introduction

Java Introduction

Java is a statically-typed, object-oriented language running on the JVM. It powers enterprise applications, Android, big data platforms, and more.

Key Concepts

  • JVM: The Java Virtual Machine executes compiled bytecode.
  • JRE: The Java Runtime Environment (JVM + standard libraries) to run apps.
  • JDK: The Java Development Kit (JRE + compilers/tools) to build apps.
  • WORA: Write Once, Run Anywhere—portable bytecode across platforms.
  • LTS releases: Long-Term Support versions (e.g., 8, 11, 17, 21) are common in production.

Hello, World

Save this as Hello.java:

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

Compile and run:

# compile
javac Hello.java
# run
java Hello

Typical Use Cases

  • Enterprise backends (REST, microservices)
  • Android applications (Kotlin and Java interop)
  • Big data (Hadoop ecosystem), stream processing
  • Trading systems and low-latency services

Next Steps

  1. Install a modern JDK and IDE/tooling.
  2. Learn syntax, variables, control flow.
  3. Dive into OOP: classes, interfaces, inheritance.
  4. Master collections, generics, exceptions.
  5. Explore lambdas, streams, and concurrency.
Tip for teachers: emphasize the compile → run loop and static typing feedback. Tip for architects: align on LTS versions and dependency management.

Try it

  1. Create Hello.java, compile with javac Hello.java, and run with java Hello.
  2. Edit the message to print your name and run it again.
  3. Use jshell to evaluate 40 + 2 and "Hi " + "Java".