nerdexam
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

1Z0-804 question #53 exhibit

Options

  • A1: First
  • B1: First
  • C1: First
  • DIOExcepton
  • ECompilation fails

How the community answered

(48 responses)
  • A
    6% (3)
  • B
    75% (36)
  • C
    2% (1)
  • D
    4% (2)
  • E
    13% (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.

Full 1Z0-804 Practice