Java OCA OCP Practice Question 2034

Question

If write(0x01234567) is called on an instance of OutputStream, what will be written to the destination of the stream?.

Select the one correct answer.

  • (a) The bytes 0x01, 0x23, 0x34, 0x45, and 0x67, in that order.
  • (b) The bytes 0x67, 0x45, 0x34, 0x23, and 0x01, in that order.
  • (c) The byte 0x01.
  • (d) The byte 0x67.
  • (e) None of the above.


(d)

Note

The write() method writes bytes only.

When given an int it only writes the 8 least significant bits.




PreviousNext

Related