Sail E0 Webinar

MCQs

Total Questions : 17 | Page 2 of 2 pages
Question 11. Which of these class is used to read from byte array?
  1.    InputStream.
  2.    BufferedInputStream.
  3.    ArrayInputStream.
  4.    ByteArrayInputStream.
 Discuss Question
Answer: Option D. -> ByteArrayInputStream.


ByteArrayInputStream.


Question 12. 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 13. Which of these class is used to read characters and strings in Java from console?
  1.    BufferedReader
  2.    StringReader
  3.    BufferedStreamReader
  4.    InputStreamReader
 Discuss Question
Answer: Option A. -> BufferedReader


BufferedReader


Question 14. Which of these is used to read a string from the input stream?
  1.    get()
  2.    getLine()
  3.    read()
  4.    readLine()
 Discuss Question
Answer: Option D. -> readLine()


readLine()


Question 15. Which exception is thrown by read() method?
  1.    IOException
  2.    InterruptedException
  3.    SystemException
  4.    SystemInputException
 Discuss Question
Answer: Option A. -> IOException


read method throws IOException.


Question 16. 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 17. Which of the following statement is correct?
  1.    reverse() method reverses all characters.
  2.    reverseall() method reverses all characters.
  3.    replace() method replaces first occurrence of a character in invoking string with another character.
  4.    replace() method replaces last occurrence of a character in invoking string with another character.
 Discuss Question
Answer: Option A. -> reverse() method reverses all characters.


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


Latest Videos

Latest Test Papers