Skip to content
Learn Netverks

Lesson

Step 1/36 3% through track

intro

Introduction to Java

Last reviewed May 28, 2026 Content v20260528
Track mode
server_compiled
Means
Compiled runner
Reading
~3 min
Level
beginner

This lesson

An orientation to the Java track—how the server playground works, core vocabulary, and what you will practice next.

You need a clear map of the Java track so the JVM, compile step, and OOP vocabulary do not feel like magic.

You will apply Introduction to Java in contexts like: Spring Boot APIs, banking systems, Android (with Kotlin), and batch/data pipelines on the JVM.

Write Java with a public class (lessons use Main), click Run on server—the dev runner runs javac then java; fix compile errors from stderr (LEARNING_RUNNER_ENABLED=true). Also read the interview prep blocks.

After HTML fundamentals and basic programming concepts—before or alongside SQL.

How this Java track works

  • Compiled Java in the playground — write a public class Main with public static void main(String[] args); the dev runner runs javac then java. Use System.out.println for output.
  • Class name must match the file — the public class name equals the filename (Main.java). Fix compile errors from stderr before re-running.
  • Prerequisites — finish JavaScript (functions, objects) and PHP (OOP basics) for comparison. Java is strongly typed and class-centric from the start.

JDBC, Maven, and Spring lessons use conceptual prose plus println mock data—real projects need a local JDK, database, and build tool.

Install on your device (macOS, Linux, Windows)

Install JDK 17 or 21 to compile and run Java locally; playground uses javac/java on the runner.

macOS

  1. brew install openjdk@21
  2. Follow Homebrew caveats to add JDK to PATH (/opt/homebrew/opt/openjdk@21/bin).

Linux

  1. Debian/Ubuntu: sudo apt install -y openjdk-21-jdk
  2. Fedora: sudo dnf install -y java-21-openjdk-devel

Windows

  1. winget install Microsoft.OpenJDK.21 or Oracle/Temurin installer from adoptium.net.

Verify: java -version and javac -version succeed.

Run code on this site (Backend & language playgrounds)

  1. Clone or open this project locally; copy .env.example to .env.
  2. Ensure LEARNING_RUNNER_ENABLED=true and LEARNING_RUNNER_URL=http://127.0.0.1:9999/v1/execute.
  3. Terminal 1: php artisan serve (or composer run dev for Laravel + Vite + runner together).
  4. Terminal 2: npm run runner — keep it running while you click Run on server.

Java is a statically typed, object-oriented language that runs on the Java Virtual Machine (JVM). The same bytecode can run on Linux servers, Windows laptops, and cloud containers—"write once, run anywhere" means compile to bytecode, then ship a JRE or container image.

How this track differs from JavaScript and PHP

After the JavaScript track, you know functions and objects in a dynamically typed browser runtime. After PHP, you have seen classes and server-side logic. Java is strongly typed from the first line: every variable has a declared type, and the compiler catches many mistakes before you run anything.

Java is not a scripting language you paste into HTML—it is compiled (javac) then executed (java). Enterprise APIs, Android backends (often Kotlin today), and batch jobs still lean heavily on Java patterns.

What you will learn

  • Core syntax: classes, main, types, control flow, and methods
  • OOP: encapsulation, inheritance, polymorphism, and interfaces
  • Collections: arrays, ArrayList, HashMap, generics basics
  • Exceptions, packages, I/O, and modern features (streams, Optional, records)
  • Conceptual JDBC, Maven/Gradle, and a Spring teaser for interview context

Playground setup

This topic uses the server_compiled profile: your code compiles and runs on the dev runner. Use public class Main with public static void main(String[] args) and System.out.println for output. The public class name must match the filename (Main.java).

Self-check

  1. In one sentence, what executes Java bytecode?
  2. Why do we recommend JavaScript and PHP before this track?

Interview prep

What is Java in one sentence?

A statically typed, object-oriented language that compiles to JVM bytecode—run anywhere a Java runtime is installed, with strong enterprise and Spring ecosystem support.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Why learn Java after scripting?
  • First JVM project idea?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump