Skip to content

Modern Java

A long, example-driven tutorial teaching the new language and API features of Java 8.winterbe/java8-tutorial

Stars
16.7k
Forks
4k
Licence
MIT
Language
Java
Last update
3.2 years ago
Type
Learning resource

No commits in over a year — check for forks or alternatives before adopting.

What it is

This is a written tutorial, not a program, that walks through the new features added in Java 8, such as lambda expressions, default interface methods, streams, and the new Date API. Each section pairs a short explanation with small commented code samples. It is useful for learning how Java code changed in that version.

  • Learn how lambda expressions replace anonymous classes
  • Practice method and constructor references with the provided examples
  • Understand how streams, Optionals, and the Date API work in Java 8

Great for

  • Java developers who work on older Java code and want to learn Java 8 features
  • Students learning Java who want short, runnable-style examples
  • Developers who already know Java and want a quick refresher on lambdas and streams

Not ideal for

  • Readers who need the latest Java features, since the README points to a separate Java 11 tutorial for later versions
  • People who want a software tool to install, because this is a guide to read rather than an application
Step-by-step guide: how to use Modern JavaInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Read it online

    You'll need: Java (Java 8 or later for running the examples)

    Clone the repository

    git clone https://github.com/winterbe/java8-tutorial
  2. 2

    Run it

    • Open the README on GitHub or in the cloned folder
    • Read the Default Methods and Lambda expressions sections first
    • Copy the code samples into a Java file and run them with a Java 8 or later compiler
  3. 3

    Get the most out of it

    • Follow the table of contents and work through the sections in order
    • Try modifying each code sample to see how the behavior changes
    • Read the linked Java 11 tutorial from the README for newer features

Downloads

Strengths

  • Short code samples with comments make concepts easy to follow
  • Covers a broad set of Java 8 features in one place
  • Free and open source under the MIT license

Trade-offs

  • Covers only Java 8; newer language and API features are in a separate guide referenced in the README
  • The README provided is truncated, so the full set of topics could not be fully verified here

How it compares

ProjectStarsTypeLevelUpdatedBest for
java8-tutorial (this)16.7kLearning resourcebeginner3.2 years agoJava developers who work on older Java code and want to learn Java 8 features
claude-howto46.4kLearning resourcebeginner4 days agoDevelopers who have installed Claude Code and want to go beyond basic prompts
pure-bash-bible41.7kLearning resourceintermediate2.9 years agoBash scripters who want fewer external dependencies in their scripts
first-contributions56.7kLearning resourcebeginner4 days agoPeople who have never submitted a pull request to an open source project
learn-python18.5kLearning resourcebeginner7 months agoBeginners who want to learn Python syntax by reading and running examples
raspberry-pi-os14kLearning resourceadvanced2.6 years agoStudents who want to understand how operating systems work at the lowest level

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.