Java OCA OCP Practice Question 2036

Question

Which of these classes provides methods for writing binary representations of Java primitive values?.

Select the two correct answers.

  • (a) DataOutputStream
  • (b) FileOutputStream
  • (c) ObjectOutputStream
  • (d) PrintStream
  • (e) BufferedOutputStream


(a) and (c)

Note

Classes that implement the DataOutput interface, i.e., DataOutputStream and ObjectOutputStream, provide methods for writing binary representations of primitive values.

The output stream classes FileOutputStream, PrintStream, and BufferedOutputStream do not provide such methods.




PreviousNext

Related