# Getting Started

## What This Project Does

This repository is a compact set of Java 11 examples. Each package demonstrates one language or platform feature in isolation, so you can read a small example, run it, and see the output immediately. There is no large application framework here — think of it as a hands-on tour of Java 11 APIs.

## Recommended Reading Order

1. [`README.md`](README.md) — quickest way to understand the repo’s purpose and the feature list.
2. [`src/main/java/io/github/biezhi/java11/collections/Example.java`](src/main/java/io/github/biezhi/java11/collections/Example.java) — a simple starting point that shows the overall style.
3. [`src/main/java/io/github/biezhi/java11/string/Example.java`](src/main/java/io/github/biezhi/java11/string/Example.java) and [`src/main/java/io/github/biezhi/java11/var/Example.java`](src/main/java/io/github/biezhi/java11/var/Example.java) — two of the most approachable language-feature demos.
4. [`src/main/java/io/github/biezhi/java11/files/Example.java`](src/main/java/io/github/biezhi/java11/files/Example.java) and [`src/main/java/io/github/biezhi/java11/trywithresources/Example.java`](src/main/java/io/github/biezhi/java11/trywithresources/Example.java) — useful for understanding I/O and resource handling.
5. [`src/main/java/io/github/biezhi/java11/http/Example.java`](src/main/java/io/github/biezhi/java11/http/Example.java) — the broadest example and the best place to see multiple APIs working together.

## Key Entry Points

The repository does not have a highly connected class graph, so the main entry points are the package-level `Example` classes.

- [`src/main/java/io/github/biezhi/java11/collections/Example.java`](src/main/java/io/github/biezhi/java11/collections/Example.java)
- [`src/main/java/io/github/biezhi/java11/string/Example.java`](src/main/java/io/github/biezhi/java11/string/Example.java)
- [`src/main/java/io/github/biezhi/java11/var/Example.java`](src/main/java/io/github/biezhi/java11/var/Example.java)
- [`src/main/java/io/github/biezhi/java11/http/Example.java`](src/main/java/io/github/biezhi/java11/http/Example.java)
- [`src/main/java/io/github/biezhi/java11/http/Foo.java`](src/main/java/io/github/biezhi/java11/http/Foo.java) — the small data object used by the HTTP example

## Project Structure

Source code lives under `src/main/java/io/github/biezhi/java11/`, with one subpackage per Java 11 topic:

- `collections` — collection factory methods and the diamond operator
- `files` — modern file read/write helpers
- `http` — `HttpClient` examples, including request/response patterns
- `interfaces` — default, private, and static interface methods
- `processor` — process API usage
- `singlefile` — single-source-file execution example
- `string` — new `String` methods such as `strip`, `lines`, and `repeat`
- `time` — `Duration` and `TimeUnit` conversions
- `trywithresources` — updated try-with-resources syntax
- `var` — local variable type inference

The project is organized as a teaching repo rather than a layered application. Each package is intentionally small and self-contained.

## Configuration

The main configuration file is [`pom.xml`](pom.xml). It controls:

- the Maven coordinates for the project
- the Java release level (`11`)
- the `gson` dependency used by the HTTP example
- the Surefire JVM argument that enables `jdk.incubator.httpclient`

There are no application property files or runtime configuration layers to learn first.

## Common Patterns

- **One feature per package** — each directory focuses on a single Java 11 capability.
- **Example-driven code** — classes are usually named `Example` and demonstrate behavior through small, runnable methods.
- **Console-first output** — most demos show results by printing to standard output rather than wiring a UI or service.
- **Standard library heavy** — code mostly uses the JDK directly, with `Gson` appearing only in the HTTP example.
- **Minimal shared state** — examples are designed to be read independently, so there is little cross-package coupling.

## Where to Go Next

If you want to go deeper, read the package page for the feature you care about most, then open the matching `Example` class and run it locally. For a broad overview of all packages, start with the `collections`, `string`, and `http` examples first.