✏️ Explanatory Question
When writing to a text file using PrintWriter, data is written as characters using methods like print() and println(). In contrast, writing to a binary file with a DataOutputStream uses methods that correspond to specific primitive data types, such as writeInt(), writeDouble(), and writeBoolean(), which write the data in a machine-readable binary format.