To write primitive data types like int or double to a file in a machine-independent way, you might use ________.
- DataOutputStream
- FileInputStream
- ObjectInputStream
- ObjectOutputStream
To write primitive data types to a file in a machine-independent way, you can use DataOutputStream. It provides methods for writing different data types to a file while ensuring that the data can be read back correctly.
Loading...
Related Quiz
- What is the purpose of a parameterized constructor in Java?
- How does the Java NIO (New I/O) package enhance the performance of a network application in terms of I/O operations?
- What is the main disadvantage of the Bubble Sort algorithm in terms of performance?
- When a thread acquires a lock for a synchronized method, what happens to the other threads that are trying to access it?
- The InputStream and OutputStream classes are part of the ________ package.