Core Java - Interview Questions and Answers for 'Reader' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Core Java - Interview Questions and Answers for 'Reader' - 5 question(s) found - Order By Newest

 Q1. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?Core Java
Ans. The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented

  Sample Code for InputStream

  Sample Code for OutputStream

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   file io   streams   reader class   writer class   inputstream   outputstream   stream  file handling


 Q2. Which class is used to read streams of characters from a file?Core Java
Ans. FileReader

  Sample Code for FileReader

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   io   file   fileio   filereader  file handling


 Q3. Name few Reader classes ?
Ans. http://www.buggybread.com/2015/01/java-input-reader-classes-and-interfaces.html

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   input output   io   reader


 Q4. Difference between Scanner and BufferedReader ? Which one is faster and Why ?Core Java
Ans. Scanner is used for parsing tokens from the contents of the stream while BufferedReader just reads the stream.

BufferedReader read files efficiently by using a buffer to avoid physical disk operations.

Buffer size of Scanner is usually smaller than the Buffered Writer.

BufferedReader is faster that Scanner as it just reads the Stream and doesn't Parse the tokens to read the stream into primitive data types.

  Sample Code for Scanner

  Sample Code for BufferedReader

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   file io   input output   scanner   bufferedreader  file handling


 Q5. How does encoding affect using Reader / writer classes or Stream classes in Java ? Core Java
Ans. Which group of bytes represent which character is defined by character encoding. So when reading character by character from a stream of bytes using Reader, specifying character encoding becomes significant as the same group of bytes can represent different character in different character encoding(Eg UTF-8 and UTF-16 etc.)

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     File io  File handling  Reader  Writer  Stream     Asked in 1 Companies



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: