Ace Java 2025: Rock Your 'Thinking in Java' Challenge!

Image Description

Question: 1 / 510

Which class is used to create a memory-mapped file for reading and writing?

FileInputStream

RandomAccessFile

RandomAccessFile is the correct answer because it is specifically designed for reading and writing files and provides methods for accessing any part of the file. FileInputStream is used for only reading and does not allow for writing to the file. MappedByteBuffer is used for mapping a specific portion of a file to memory and is not used for creating a file. FileChannel does not create a file but is used for reading, writing, and manipulating files. Therefore, RandomAccessFile is the best choice for creating a memory-mapped file for reading and writing.

Get further explanation with Examzify DeepDiveBeta

MappedByteBuffer

FileChannel

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy