Oracle
1Z0-804 · Question #53
Given that myFile.txt contains: What is the result?
The correct answer is B. 1: First. BufferedReader: mark() : Marks the present position in the stream. Subsequent calls to reset() will attempt toreposition the stream to this point. reset() : Resets the stream to the most recent mark. !! After last Line is read (readLine()), a trial to reset() throws IOException…
NIO.2
Question
Given that myFile.txt contains:
What is the result?
Exhibit
Options
- A1: First
- B1: First
- C1: First
- DIOExcepton
- ECompilation fails
How the community answered
(48 responses)- A6% (3)
- B75% (36)
- C2% (1)
- D4% (2)
- E13% (6)
Explanation
BufferedReader: mark() : Marks the present position in the stream. Subsequent calls to reset() will attempt toreposition the stream to this point. reset() : Resets the stream to the most recent mark. !! After last Line is read (readLine()), a trial to reset() throws IOException : Mark invalid
Topics
#Files.readAllLines#Path#BufferedReader#line reading
Community Discussion
No community discussion yet for this question.
