Same 10 lines written two ways. Watch how often each one touches the disk — and why that matters.
FileWriter sends every write straight to disk. BufferedWriter wraps it and holds writes in an 8 KB in-memory buffer, flushing to disk only when the buffer fills or when you call close(). Fewer disk trips → faster program.
Tip: press Write 10 lines and compare disk trips. FileWriter = 10 trips. BufferedWriter = still 0 (nothing reached the disk yet). Press close() to flush the buffer.