Introduction to Java

Java is a robust, class-based, object-oriented programming language designed for portability ("Write Once, Run Anywhere"). It powers large-scale enterprise backends (Spring Boot), Android applications, and financial transaction engines.

Why Learn Java?

Write Once, Run Anywhere (WORA)

Compiled into bytecode that runs on any operating system equipped with a Java Virtual Machine (JVM).

Enterprise Dominance

Spring Boot and Java EE form the technological foundation for thousands of banks, healthcare systems, and Fortune 500 corporations.

Automatic Memory Management

High-performance Garbage Collection (G1, ZGC) automatically cleans unused objects, preventing memory leaks without manual pointers.

First Java Program

Every Java program requires at least one class definition whose name matches the filename.

Main Class (Main.java):
Main.java
1public class Main { 2 // Application entry point 3 public static void main(String[] args) { 4 System.out.println("Hello, World! Welcome to Java Programming."); 5 } 6}

Running with the JDK

javac and java commands:
terminal
1# 1. Compile into bytecode (Main.class) 2javac Main.java 3 4# 2. Execute with JVM 5java Main 6 7# Single-file source-code launcher (Java 11+) 8java Main.java