Java Cours

Introduction to Java

Tutoriel Python 3 pour débutants.

What is Java?

Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. It was created by James Gosling at Sun Microsystems in 1995 and is now owned by Oracle.

Key Features

  • Write Once, Run Anywhere (WORA) — Java code compiles to bytecode that runs on the JVM on any platform
  • Object-Oriented — everything is an object (except primitives)
  • Strongly Typed — every variable must have a declared type
  • Garbage Collected — memory is managed automatically

How Java Works

Java source code (.java) is compiled by javac into bytecode (.class), which is then executed by the Java Virtual Machine (JVM).

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

Compiling and Running

javac HelloWorld.java   // compile
java HelloWorld         // run

Where Java is Used

  • ☕ Android app development (Android SDK)
  • 🏦 Enterprise backend systems (Spring, Hibernate)
  • 🌐 Web servers and microservices
  • 📊 Big Data tools (Hadoop, Kafka, Spark)

Java Versions

Java releases a new LTS (Long Term Support) version every few years. The most widely used LTS versions are Java 11, Java 17, and Java 21. Modern Java adds powerful features like records, sealed classes, and pattern matching.