Orientation

intro1AboutJava

Path
pkg0intro/intro1AboutJava.java
Package
pkg0intro
Study order
1
Run
Single-file source launch
Command
java pkg0intro/intro1AboutJava.java
Lesson
Back to the chapter

There is no in-browser runner. This is the file from the curriculum, unchanged.

pkg0intro/intro1AboutJava.java
1package pkg0intro;2 3/*4 * intro1AboutJava.java5 * --------------------6 * WHAT IS JAVA? A definition + the core ideas, as a runnable tutorial.7 *8 * DEFINITION:9 *   Java is a high-level, class-based, object-oriented, statically-typed,10 *   general-purpose programming language designed to have as few implementation11 *   dependencies as possible. Source compiles to bytecode that runs on any12 *   Java Virtual Machine (JVM) -> "Write Once, Run Anywhere" (WORA).13 *14 * KEY CHARACTERISTICS:15 *   - Simple & familiar (C/C++-like syntax, no pointers/manual memory)16 *   - Object-oriented (everything revolves around classes & objects)17 *   - Platform independent (bytecode + JVM)18 *   - Robust (strong typing, exceptions, garbage collection)19 *   - Secure (bytecode verification, sandboxing, no raw pointers)20 *   - Multithreaded (built-in concurrency support)21 *   - Architecture neutral & portable22 *   - High performance (JIT compilation)23 *   - Distributed & dynamic24 */25public class intro1AboutJava {26    public static void main(String[] args) {27        System.out.println("=== WHAT IS JAVA? ===\n");28        System.out.println("Java is a high-level, object-oriented, platform-independent language.");29        System.out.println("Source (.java) -> compiler (javac) -> bytecode (.class) -> JVM -> runs anywhere.\n");30 31        String[] pillars = {32            "Simple & familiar       : C-like syntax, automatic memory management",33            "Object-oriented         : classes, objects, inheritance, polymorphism",34            "Platform independent    : bytecode runs on any JVM (WORA)",35            "Robust                  : strong typing, exception handling, GC",36            "Secure                  : bytecode verification, no raw pointers",37            "Multithreaded           : first-class threads & concurrency",38            "Portable                : fixed primitive sizes, no platform quirks",39            "High performance        : Just-In-Time (JIT) compilation",40            "Distributed & dynamic   : networking libraries, runtime class loading"41        };42        System.out.println("THE BUZZWORDS (Java's design pillars):");43        for (String p : pillars) System.out.println("  - " + p);44 45        System.out.println("\nEDITIONS:");46        System.out.println("  - Java SE  (Standard Edition)  : core language + standard library");47        System.out.println("  - Java EE / Jakarta EE         : enterprise APIs (web, persistence)");48        System.out.println("  - Java ME  (Micro Edition)     : constrained/embedded devices");49 50        System.out.println("\nJDK vs JRE vs JVM:");51        System.out.println("  - JVM : executes bytecode (memory, GC, JIT)");52        System.out.println("  - JRE : JVM + standard libraries (to RUN apps)");53        System.out.println("  - JDK : JRE + compiler & tools (to BUILD apps)");54 55        System.out.println("\nThis runtime: Java " + System.getProperty("java.version")56                + " on " + System.getProperty("os.name"));57    }58}