Sail E0 Webinar

MCQs

Total Questions : 51 | Page 4 of 6 pages
Question 31.

Which of these classes are used by character streams output operations?


  1.    InputStream
  2.    Writer
  3.    ReadStream
  4.    InputOutputStream
 Discuss Question
Answer: Option B. -> Writer

Character streams uses Writer and Reader classes for input & output operations.


Question 32.

Which of these class is used to read from a file?


  1.    InputStream
  2.    BufferedInputStream
  3.    FileInputStream
  4.    BufferedFileInputStream
 Discuss Question
Answer: Option C. -> FileInputStream

None


Question 33.

Which of these is a method to clear all the data present in output buffers?


  1.    clear()
  2.    flush()
  3.    fflush()
  4.    close()
 Discuss Question
Answer: Option B. -> flush()

none.



Question 34.

Which of these exception is thrown by close() and read() methods?


  1.    IOException
  2.    FileException
  3.    FileNotFoundException
  4.    FileInputOutputException
 Discuss Question
Answer: Option A. -> IOException

Both close() and read() method throw IOException.


Question 35.

Which of these class is implemented by FilterInputStream class?


  1.    InputStream
  2.    InputOutputStream
  3.    BufferedInputStream
  4.    SequenceInputStream
 Discuss Question
Answer: Option A. -> InputStream

FileInputStream implements InputStream.


Question 36.

Which of these method of class StringBuffer is used to reverse sequence of 

characters?


  1.    reverse()
  2.    reverseall()
  3.    Reverse()
  4.    reverseAll()
 Discuss Question
Answer: Option A. -> reverse()

reverse() method reverses all characters. It returns the reversed object on which 

it was called.


Question 37.

Which of these values is returned by read() method is end of file (EOF) is

encountered?


  1.    0
  2.    1
  3.    -1
  4.    Null
 Discuss Question
Answer: Option C. -> -1

Each time read() is called, it reads a single byte from the file and returns the byte 

Question 38.

Which of these classes are used by Byte streams for input and output operation?


  1.    InputStream
  2.    InputOutputStream
  3.    Reader
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> InputStream

Byte stream uses InputStream and OutputStream classes for input and output operation.


Question 39.

Which of these class can be used to implement input stream that uses a character array as the source?


  1.    BufferedReader
  2.    FileReader
  3.    CharArrayReader
  4.    FileArrayReader
 Discuss Question
Answer: Option C. -> CharArrayReader

CharArrayReader is an implementation of an input stream that uses character array as a source. 

Here array is the input source.


Question 40.

Which of these methods are used to read in from file?


  1.    get()
  2.    read()
  3.    scan()
  4.    readFileInput()
 Discuss Question
Answer: Option B. -> read()

Each time read() is called, it reads a single byte from the file and returns the byte as 

Latest Videos

Latest Test Papers