Loading lesson…
Level 1 · Apprentice0 XP
Read and write files safely, and always close what you open.
Step 1 / 6
ProblemA service opens a file for each request and forgets to close it on errors. After a day, the operating system refuses to open more files and the service crashes.
← → step
Before this: Dates and times with java.time
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Stream a large CSV file, count rows per status, and write a summary file. Use try-with-resources and UTF-8 everywhere, and make it work on a 1 GB generated file without increasing heap.