Input/Output and Streams in Java
Learn to read and write files, process Java collections with iterators and streams, and use recursion, dates and enums in reusable Java code.
Java code that saves data needs to create, read, write and delete files and keep them organized in folders, while code that handles lists needs safe ways to walk through, update and summarize them. Here you store notes on disk, filter and transform collections with the stream approach, and write recursive and overriding methods alongside date calculations and enums that model fixed sets of values such as web responses.
What You Will Achieve
- Save notes to disk, read them back, and verify where each file ends up
- Update items in a list safely while looping, such as renaming contacts or undoing an edit
- Turn raw lists into results such as filtered email counts, unique city sets, or sales totals
- Write a recursive sum method and calculate a subscription’s expiration date
Program Overview
File Input/Output and Directories
A notes scenario anchors the work with files, their contents, and the folders and paths that hold them.
- Creating, checking, and deleting files
- Reading and writing text, including long notes
- Caching recent notes
- Managing directories and file paths
Collections with Iterators and Streams
Lists are navigated and changed element by element, then processed with streams for filtering, transforming and summarizing.
- Looping through lists with iterators
- Modifying lists with ListIterator
- Filtering, counting, and transforming with streams
- Collecting unique values and calculating totals
Reusable Methods, Dates, and Enums
Method design, date handling and enums are practiced separately, then combined in closing exercises.
- Method overriding and recursion
- Formatting, parsing, and calculating dates
- Enums for fixed values and application states
- Combining custom methods in practice
Certificate Awarded (Paid)
Job Outlook
These skills apply wherever Java programs store data in files, process lists of records such as users, emails or sales, and handle dates and fixed states in application code.
Good for: Java learners ready to move past syntax exercises into practical tasks such as storing notes, filtering email lists and computing dates.
Keep in mind: Streams, recursion and date handling are each practiced on a few short tasks rather than combined into one larger application.
Bottom line: A compact set of practical drills on Java file handling, stream processing and enums, built around everyday tasks such as notes, contacts and subscriptions.
Frequently Asked Questions
What kind of program do the file exercises build?
The first chapter works around a simple notes scenario. You point to a first note file, keep recent notes in a cache, write and read a note, handle long notes efficiently, then organize the notes into a folder and check where they are stored.
How are iterators used before streams are introduced?
The second chapter starts with iterators for walking through a list, for example to display city names or filter large numbers, and uses ListIterator to change entries in place, such as updating contact names or undoing the last action in a text editor. Streams follow for filtering, transforming and summarizing data.
How are enums used in the exercises?
Enums represent fixed sets of values in several settings: a navigation exercise, managing web responses, and tracking the states an application moves through. Application states return in the closing exercises, where enums are combined with custom methods and date handling.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.