Java

Java Programming Foundations

The JVM execution model, core language syntax, object-oriented design, exceptions, generics, modern streams, and real automated testing with JUnit.

intermediate14 lessons6 modules8h total

Helpful before you begin (optional -- you can start this course now): JavaScript Fundamentals

Who it's for

Developers who already know one programming language's fundamentals (variables, functions, conditionals, loops, basic collections) and want a statically-typed, object-oriented language behind much of the enterprise and Android world.

What you'll be able to do

  • Explain the JDK/JVM/bytecode model and compile and run a real multi-class Java program
  • Use Java's primitive and reference types, control flow, and methods correctly, including overload resolution
  • Design a small domain using encapsulation, composition, interfaces, and polymorphism
  • Handle failure with checked and unchecked exceptions, and implement equals/hashCode correctly
  • Use lambdas and the Stream API to express filter/map/reduce pipelines
  • Add JUnit tests and use try-with-resources for guaranteed resource cleanup

Not started — 14 lessons, no account required.

Start this course

Practice this course →Add to a study plan →Interview questions

Java execution and language fundamentals

The JDK/JVM/bytecode mental model, program structure, types, operators, and strings.

  1. The JVM, the JDK, and How a Java Program Runs

    What actually happens between writing Java source code and seeing a program run — and why that model makes Java portable.

    18 min
  2. Variables, Primitive Types, and Reference Types

    Why Java makes you declare a type for every variable, and the one distinction — primitive vs. reference — that explains most of Java's variable behavior.

    20 min
  3. Operators, Expressions, and Working with Strings

    Arithmetic, comparison, and logical operators, and the String methods you'll reach for constantly — plus the immutability trap that catches every beginner once.

    18 min

Decisions, repetition, and methods

Conditions and loops, then method design, parameters, returns, and overloading.

  1. Control Flow: Conditions, Loops, and Modern Switch

    if/else, the three loop forms, and Java's modern switch expression — including the exhaustiveness checking that catches a forgotten case at compile time.

    19 min
  2. Methods: Parameters, Return Values, and Overloading

    How Java methods pass data in and out, and how the compiler picks the right method when several share a name but differ in parameters.

    19 min

Data and collections

Fixed-size arrays, then List, Set, and Map — and when to reach for each.

  1. Arrays: Fixed-Size, Typed, and Zero-Indexed

    Java's array type — how to declare, fill, and iterate one, why its length is fixed forever, and the exception you'll hit constantly until you internalize the valid-index range.

    17 min
  2. Collections: List, Set, and Map

    The three collection interfaces you'll use in nearly every Java program, and the practical rule of thumb for choosing between them.

    20 min

Object-oriented design

Classes, constructors, encapsulation, inheritance vs. composition, interfaces, and polymorphism.

  1. Classes, Objects, Constructors, and Encapsulation

    How a class becomes a blueprint for objects, why constructors exist, and why hiding a field behind private plus getters/setters is worth the extra typing.

    21 min
  2. Inheritance vs. Composition, Packages, and Access Control

    When 'is-a' (inheritance) actually fits better than 'has-a' (composition) — and why most experienced Java developers reach for composition by default.

    21 min
  3. Interfaces, Abstract Classes, and Polymorphism

    How Java lets you write code against a contract instead of a concrete type — and the practical difference between an interface and an abstract class.

    22 min

Reliable Java programs

Checked and unchecked exceptions, generics, and the equals/hashCode/immutability contract.

  1. Exceptions: Checked, Unchecked, and Handling Them Well

    Java's two families of exceptions, why the compiler forces you to acknowledge one but not the other, and how to fail in a way that actually helps whoever hits the error.

    20 min
  2. Generics, Equality, hashCode, and Immutability

    Type-safe reusable code with generics, the equals/hashCode contract every class in a HashSet or HashMap must honor, and why immutable objects eliminate an entire category of bugs.

    21 min

Modern Java and testing

Lambdas and Streams, then try-with-resources, JUnit, debugging, and project structure.

  1. Lambdas and the Stream API

    Passing behavior as a value with lambdas, and chaining map/filter/reduce-style operations over a collection with Streams instead of hand-written loops.

    20 min
  2. Resource Safety, Unit Testing, and Maintainable Project Structure

    try-with-resources, writing real JUnit tests, debugging technique, and organizing a Java project so it stays maintainable as it grows.

    22 min

Where to go next

Optional -- these build well on what you just learned, but any course can come next.