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. |
|
| ||||
Core Java - Interview Questions and Answers for 'Bufferedwriter' - 3 question(s) found - Order By Newest | ||||
| ||||
Ans. BufferedWriter is temporary source for data storage.BufferedWriter is used to write character data to the file.Flush() is method available in B.W which ensures that all data items are written to file including last character.Close() is used to closes the character output stream. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   java io   input output   file handling   file io   output stream   bufferedwriter   flush   close | ||||
Related Questions | ||||
How and when the Buffer is cleared when using Buffered Writer Classes ? | ||||
Difference between save and flush in Hibernate ? | ||||
Have you ever faced any problem because of PrintWriter buffer and autoflush mechanism ? How did you got rid of it ? | ||||
Can we disable auto flushing for PrintWriter ? | ||||
| ||||
Ans. c. File file = new File("../file.txt"); FileWriter fileWriter = new FileWriter(file); BufferedWriter bufferedOutputWriter = new BufferedWriter(fileWriter); | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   io   file   fileio   coding   code   filewriter   bufferedwriter   scjp   ocjp  file handling | ||||
Related Questions | ||||
What is a stream and what are the types of Streams and classes of the Streams? | ||||
Name few File IO related classes and interfaces ? | ||||
Tell something about BufferedWriter ? What are flush() and close() used for ? | ||||
What is Scanner class used for ? when was it introduced in Java ? | ||||
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy? | ||||
Which is the abstract parent class of FileWriter ? | ||||
Which class is used to read streams of characters from a file? | ||||
Which class is used to read streams of raw bytes from a file? | ||||
Which is the Parent class of FileInputStream ? | ||||
Difference between Scanner and BufferedReader ? Which one is faster and Why ? | ||||
| ||||
Ans. Buffer is cleared in 2 circumstances, i.e 1. naturally when the buffer is filled and 2. explicitly when the method flush is called ( for flushing the residual ) Ideally we just need to call flush once at the end of file writing so that the residual content should be dumped to file. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  BufferedWriter  Writer  PrintWriter  File io  flush  file handling | ||||
Related Questions | ||||
Tell something about BufferedWriter ? What are flush() and close() used for ? | ||||
Difference between save and flush in Hibernate ? | ||||
Have you ever faced any problem because of PrintWriter buffer and autoflush mechanism ? How did you got rid of it ? | ||||
Can we disable auto flushing for PrintWriter ? | ||||