1Z0-829 Java I/O API and Securing Applications Practice Question
Which class provides a convenient means to read text from a file line by line?
⚠ Common exam trap
Test-takers frequently choose Scanner (option B) because they know it has `nextLine()`, but they overlook that Scanner is not optimized for simple line-by-line file reading and is typically used for parsing structured input, whereas BufferedReader is the dedicated, efficient choice for this task.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
BufferedReader
BufferedReader (option D) is the correct answer because it provides the `readLine()` method, which reads text from a character-input stream line by line, efficiently buffering characters to avoid frequent disk reads. When wrapped around a FileReader, it enables convenient and performant line-by-line reading of text files.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
FileReader
Why it's wrong here
Reads characters, no built-in line reading.
- ✗
Scanner
Why it's wrong here
Has nextLine() but less efficient than BufferedReader.
- ✗
FileInputStream
Why it's wrong here
Binary stream, not for text.
- ✓
BufferedReader
Why this is correct
Reads text efficiently line by line.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 1Z0-829 question from scratch — 513 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.