Java Course

Java powers banking systems, Android apps, big-data platforms and countless back-end services. This course takes you from your first println to object-oriented design, collections, streams, records, sealed types, concurrency and testing — finishing with a complete library-management program. It teaches modern Java 25, and points out what differs in the older code you'll meet at work.

What you'll learn

The course has 56 lessons in nine parts:

  • Getting Started — what Java is, installing the JDK, program structure, syntax and comments.
  • Variables, Types & Strings — primitives, casting, operators, strings, formatting, maths and user input.
  • Control Flow — if, switch expressions, while and for loops.
  • Arrays & Methods — arrays, 2D arrays, methods, overloading, scope and recursion.
  • Object-Oriented Programming — classes, constructors, encapsulation, packages, inheritance, polymorphism, interfaces, records and enums.
  • Exceptions — handling, throwing and defining exceptions; try-with-resources.
  • Collections & Generics — lists, sets, maps, queues, sorting and generic types.
  • Functional & Modern Java — lambdas, streams, collectors, Optional, pattern matching, sealed types and dates.
  • Real-World Java — files, concurrency and virtual threads, regular expressions, JUnit, build tools and a final project.

Every example in the course was compiled and run with a real Java 25 JDK, and the output shown is the actual output. The Try it yourself editors let you change any example and copy it to run on your own computer with java Main.java.

No previous programming experience is needed.

Practice

  • Playground — a starter program to copy and experiment with.
  • Exercises — fill-in-the-blank tasks and programming challenges with solutions.
  • Quiz — test your understanding across the whole course.
  • Syllabus & Study Plan — learning outcomes and a week-by-week schedule.

Lessons

Getting Started

  1. Introduction to Java
  2. Setting Up Java
  3. Your First Program
  4. Syntax & Comments

Variables, Types & Strings

  1. Variables
  2. Primitive Data Types
  3. Type Casting
  4. Operators
  5. Strings
  6. String Methods & Formatting
  7. Math & Numbers
  8. User Input

Control Flow

  1. Booleans & if…else
  2. switch
  3. while Loops
  4. for Loops
  5. break, continue & Nested Loops

Arrays & Methods

  1. Arrays
  2. Multidimensional Arrays
  3. Methods
  4. Parameters & Overloading
  5. Scope & Recursion

Object-Oriented Programming

  1. Classes & Objects
  2. Static Members
  3. Constructors
  4. Encapsulation & Access Modifiers
  5. Packages & Imports
  6. Inheritance
  7. Polymorphism
  8. Abstract Classes
  9. Interfaces
  10. Records
  11. Enums
  12. Nested & Anonymous Classes
  13. The Object Class: equals, hashCode & toString

Exceptions

  1. Exceptions
  2. Custom Exceptions & try-with-resources

Collections & Generics

  1. Wrapper Classes & Autoboxing
  2. Generics
  3. Lists: ArrayList & LinkedList
  4. Sets
  5. Maps
  6. Sorting & Comparators
  7. Queues, Stacks & Deques

Functional & Modern Java

  1. Lambdas & Functional Interfaces
  2. Streams
  3. Collectors & Grouping
  4. Optional
  5. Pattern Matching & Sealed Types
  6. Dates & Times

Real-World Java

  1. Working with Files
  2. Threads & Concurrency
  3. Regular Expressions
  4. Unit Testing with JUnit
  5. Build Tools & Best Practices
  6. Project: A Library System

Practice

  1. Java Playground
  2. Java Exercises
  3. Java Quiz
  4. Syllabus & Study Plan
Where to start: begin with Introduction and set up Java in lesson 2 so you can run every example yourself. Afterwards, try Kotlin (another JVM language) or learn to store data with SQL.