Exam 21: Advanced Input/Output

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

In ____________ file access, the file is processed starting from the beginning.

(Multiple Choice)
5.0/5
(33)

Every object is assigned a serial number on the stream.What might be the result if the same object is saved twice?

(Multiple Choice)
4.9/5
(33)

What type is returned from a call to the ObjectInputStream.readObject method when reading a String from an object stream?

(Multiple Choice)
4.9/5
(42)

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

(Multiple Choice)
4.8/5
(36)

Assume we have a RandomAccessFile object, file, that 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 1st record, which code correctly modifies the 2nd record by changing its color to Color.red through the setColor method?

(Multiple Choice)
4.8/5
(32)

The readDouble and writeDouble methods of the RandomAccessFile class, process double precision floating-point numbers as ____ quantities.

(Multiple Choice)
4.7/5
(41)

Which code moves the file pointer to the middle of a RandomAccessFile object, file?

(Multiple Choice)
4.9/5
(34)

When storing numbers in a file with fixed record sizes, it is easier to store them in __________ format.

(Multiple Choice)
4.8/5
(37)

Which class has a write method that writes a single byte?

(Multiple Choice)
4.8/5
(42)

Which of the following classes are used with data in binary form? i.FileInputStream II.FileReader III.RandomAccessFile

(Multiple Choice)
4.7/5
(37)

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.For the decrypt method below, select the correct body.Assume the key shift property is accessible to the method. public int decrypt(int b) { __________ }

(Multiple Choice)
4.9/5
(45)

Which class is used for input of binary data?

(Multiple Choice)
4.7/5
(34)

The values of the byte type range from ____ to ____.

(Multiple Choice)
4.8/5
(42)

Which expression creates an empty file named filename.txt?

(Multiple Choice)
4.9/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
(32)

Which statement is NOT correct about the OutputStream.write method?

(Multiple Choice)
4.8/5
(40)

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

(Multiple Choice)
4.8/5
(36)

Fill in the blank in the following code snippet to create an object for writing binary data to a disk file, named output.bin? try (______________________________) { Process output }

(Multiple Choice)
4.9/5
(44)

Which of the following classes are related through inheritance? i.InputStream II.InputStreamReader III.ObjectInputStream

(Multiple Choice)
4.7/5
(38)

In text format, data items are represented in human-readable form, as a sequence of ____________________.

(Multiple Choice)
4.9/5
(36)
Showing 21 - 40 of 90
close modal

Filters

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