# iluwatar/30-seconds-of-java

Collection of reusable tested Java 21 compatible code snippets that you can understand in 30 seconds or less.

Repository: https://github.com/iluwatar/30-seconds-of-java
Canonical: https://ross.abutalabs.com/products/30-seconds-of-java
Homepage: https://java-design-patterns.com/snippets.html
Language: Java
License: MIT
License Family: permissive
Topics: java, snippets, snippets-collection, snippets-library, awesome-list, hacktoberfest
Last push: 2026-08-30T11:15:07+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 35, longevity 100
- inputs: {"age_days": 3183, "days_push": 3, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1142, forks 444 (observed 2026-09-01T02:14:03.018587+00:00)

## What it is
A curated collection of reusable, tested, copy-pasteable Java 21 code snippets that can each be understood in 30 seconds or less, inspired by 30 seconds of code. It covers algorithms, utilities, and design pattern examples for Java developers.

## Use cases
- find a quick java code snippet for binary search
- learn common java algorithms with short examples
- copy tested utility code into my java project
- study java design pattern examples
- browse a curated list of java snippets
- prepare for java coding interviews

## When to choose
- you want small, tested, copy-pasteable Java snippets
- you are learning Java or reviewing algorithms
- you need quick reference examples compatible with Java 21

## When to avoid
- you need a full production library or framework with dependency management
- you need snippets for languages other than Java
- you want comprehensive, maintained implementations rather than educational snippets

## Facets
- artifact type: learning-resource
- maturity: active
- function: developer-tools, documentation
- domain: programming-languages, education, developer-tools
- platform: jvm, cross-platform
- tags: code-snippets, java-21, awesome-list, copy-paste, design-patterns, algorithms

## Member repositories
- iluwatar/30-seconds-of-java (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-09-01T02:14:03.018587+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:35:30.932379+00:00, confidence not recorded.
  - readme: https://github.com/iluwatar/30-seconds-of-java (fetched 2026-09-01T02:14:03.018587+00:00, sha 9327fd526fb0)
  - homepage: https://java-design-patterns.com/snippets.html (fetched 2026-08-29T12:40:41.148383+00:00, sha 84c0d41e7a18)
- Data as of 2026-08-30T08:39:29.467469+00:00.
