Exam 20: Streams and Binary Inputoutput

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

Use a ____ object to access a file and move a file pointer.

(Multiple Choice)
4.8/5
(42)

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)
5.0/5
(41)

A byte is composed of ____ bits and can denote ____ values.

(Multiple Choice)
4.9/5
(35)

Which is not a method available in the RandomAccessFile class?

(Multiple Choice)
4.8/5
(35)

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 encryption of picture for a key = -3?

(Multiple Choice)
4.9/5
(43)

If you write a simple Student class, what must you do in order to write Student objects to an ObjectOutputStream?

(Multiple Choice)
4.8/5
(39)

If you store information in binary form, as a sequence of bytes, you will use the ____ class(es) and their subclasses.

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
4.9/5
(39)

If we read a byte and the value represents an international character equal to 133 using an InputStream object, what is true about the int value we will read?

(Multiple Choice)
4.9/5
(34)

In Java, you use a(n) ____________ object to access a file and move its file pointer.

(Multiple Choice)
5.0/5
(38)

Assume we have a RandomAccessFile object, file, which stores a set of records of class MyData, each needing MyData.RECORD_SIZE bytes for storage. Which expression calculates the number of records in the file?

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.8/5
(34)

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.8/5
(38)

What is returned by the read method when a FileInputStream has reached the end of the file?

(Multiple Choice)
4.9/5
(43)

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

(Multiple Choice)
4.8/5
(38)

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

(Multiple Choice)
4.8/5
(39)

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

(Multiple Choice)
4.8/5
(35)

Streams access sequences of ____.

(Multiple Choice)
4.8/5
(38)

In Java, the simplest mechanism for reading text is to use the ____ class.

(Multiple Choice)
4.9/5
(31)

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.9/5
(27)
Showing 21 - 40 of 82
close modal

Filters

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