Exam 19: Streams and Binary Inputoutput

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

When constructing a Scanner from a File object, the Scanner automatically constructs a ___________.

Free
(Multiple Choice)
4.8/5
(38)
Correct Answer:
Verified

C

The ____ class is used when writing text files.

Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
Verified

A

The two IO classes used for serialization are _______ and ________.

Free
(Multiple Choice)
4.9/5
(43)
Correct Answer:
Verified

B

Which interface allows classes to be written to an ObjectOutputStream?

(Multiple Choice)
4.8/5
(36)

Which of the following cannot be serialized? I ArrayList<String> II String III Integer

(Multiple Choice)
4.8/5
(37)

__________ access allows file access at arbitrary locations, without first reading the bytes preceding the access location.

(Multiple Choice)
4.8/5
(34)

Caesar cipher uses a shift of each character by a key with a value between 1 and 255. An a with a shift equal to 3 becomes a d. A z would become a c, wrapping around the alphabet. Which key should you use to encrypt picture into mfzqrob?

(Multiple Choice)
4.8/5
(41)

How many methods are required to implement the Serializable interface?

(Multiple Choice)
4.8/5
(45)

The readInt and writeInt methods of the RandomAccessFile class read and write integers as ____ quantities.

(Multiple Choice)
4.7/5
(39)

Given a RandomAccessFile that stores a set of records of class MyData, each needing MyData.RECORD_SIZE bytes for storage, which expression gets the offset to the beginning of the 25th record?

(Multiple Choice)
4.9/5
(33)

Which is an advantage of storing numbers in binary format? I fast access II less storage needed III easy to read in a text editor

(Multiple Choice)
4.8/5
(37)

How many bytes does the read method in the InputStream class get from the file?

(Multiple Choice)
5.0/5
(28)

Which method moves the file pointer in a RandomAccessFile?

(Multiple Choice)
4.9/5
(30)

In which of the following modes can a RandomAccessFiles be opened? I "r" II "rw" III "w"

(Multiple Choice)
4.9/5
(34)

Assume we have a RandomAccessFile object, file, which stores a set of records of class MyData. The size of each record is MyData.RECORD_SIZE. Assume MyData has read and write methods, both of which take a RandomAccessFile as an argument. Method write writes the object at the current location. Method read reads the record from current location of the file into the object. If we are currently at the beginning of the 25th record, which code correctly modifies the 25th record by changing its color to Color.yellow through the setColor method?

(Multiple Choice)
4.9/5
(32)

Caesar cipher uses a shift of each character by a key with a value between 1 and 255. An a with a shift equal to 3 becomes a d. A z would become a c, wrapping around the alphabet. Which is the decryption of exmmv for a key = -3?

(Multiple Choice)
4.8/5
(33)

In Java, the byte type is a(n) ____ type.

(Multiple Choice)
4.9/5
(31)

Which statement is true regarding the following code, assuming reader is a FileInputStream object? Char ch = (char) reader.read(); I you cannot determine if you have reached the end of input II this code will throw an exception if we are at the end of input III read returns an int, so the cast is illegal

(Multiple Choice)
4.8/5
(36)

Which class is used for input of text data?

(Multiple Choice)
4.9/5
(33)

Which file storage method stores data in bytes?

(Multiple Choice)
4.9/5
(34)
Showing 1 - 20 of 82
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)