# Writing to a File

Replace the file, or add to the end of it.

![Cheat sheet: Writing to a File](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/75f9ea7d899c4496a045082f1c5c112d.webp)

- Category: Java
- Level: Journeyman
- Tags: java
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/working-with-the-filestream-filestream-defaults-cheat-sheet
