Loading…
Loading…
Ten exam-style questions on reading and writing files: read loops and -1, buffers and read counts, readLine and null, append mode, PrintWriter, Files.readString, readAllLines versus lines, newBufferedReader and open options, with explanations.
Practice questions for the article Java Reading and Writing Files: I/O Streams, Buffered Readers and Files Methods.
File-based answers were checked by running the code on real temporary files. Aim for at least 8 out of 10.
Quiz path: step 101. Take the quizzes in this order, after reading each article.
Previous quiz: I/O Stream Fundamentals (OCP 21)
Next quiz: Serialization (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.