# Io / Github / Biezhi / Java11 / Files

## Overview

This module appears to be a small Java 11 demonstration of the `java.nio.file.Files` API. It focuses on the simplest file lifecycle you usually need when working with text files: write a string to disk, read the same contents back, compare the values, and then delete the file.

The module exists as a focused example rather than a reusable library. It shows how Java 11’s `Files.writeString` and `Files.readString` remove much of the boilerplate that older file APIs required.

## Key Classes and Interfaces

### [`Example`](java11-examples-master/src/main/java/io/github/biezhi/java11/files/Example.java:12)

The only class in this package is a standalone executable example. It demonstrates a single, linear workflow over a text file named `hello.txt` in the current working directory.

#### Purpose

`Example` is intended to show the basic file operations that are common in scripts, demos, and small utilities:

- create or overwrite a text file
- read the file content back into memory
- verify the round trip
- delete the file when finished

#### Key method: `main(String[] args)`

Source: [`Example.main(String[] args)`](java11-examples-master/src/main/java/io/github/biezhi/java11/files/Example.java:14)

- **What it does:** Runs the demonstration end to end.
- **Parameters:** Accepts the standard `String[] args`, but the method does not use them.
- **Returns:** `void`.
- **Side effects:** Writes `hello.txt`, reads it, prints a boolean comparison result, and deletes the file.
- **Important behavior:** The method throws `Exception`, so any file I/O failure propagates to the caller.

The flow is deliberately simple:

1. Set `text` to the literal `