✏️ Explanatory Question

What is the purpose of "chaining" or combining stream objects, such as linking a BufferedWriter to a FileWriter?

👁 1 Views
📘 Detailed Answer
🟢 Easy
1
Total Views
10
Related Qs
0%
Progress
💡

Answer with Explanation

Chaining stream objects allows for combining the functionality of different stream classes, a process known as filtering. For example, a FileWriter object creates an output stream to a file, and linking a BufferedWriter to it adds buffering capability. Further linking a PrintWriter provides convenient print and println methods for writing formatted text to the buffered stream.