exam questions

Exam 1z0-819 All Questions

View all questions & answers for the 1z0-819 exam

Exam 1z0-819 topic 1 question 25 discussion

Actual exam question from Oracle's 1z0-819
Question #: 25
Topic #: 1
[All 1z0-819 Questions]


You want to read data through the reader object.
Which statement inserted on line 1 will accomplish this?

  • A. characters = reader.read();
  • B. reader.readLine();
  • C. characters.read();
  • D. reader.read(characters);
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
tapwa
4 months, 3 weeks ago
Selected Answer: D
D is the correct answer. The read(char[] cbuf) method of FileReader reads characters from the file and stores them in the characters[] array.
upvoted 1 times
...
lmocanasu
1 year, 4 months ago
Selected Answer: D
/** * Reads characters into an array. This method will block until some input * is available, an I/O error occurs, or the end of the stream is reached. * * @param cbuf Destination buffer * * @return The number of characters read, or -1 * if the end of the stream * has been reached * * @exception IOException If an I/O error occurs */ public int read(char cbuf[]) throws IOException { return read(cbuf, 0, cbuf.length); }
upvoted 1 times
...
Omnisumem
1 year, 5 months ago
Selected Answer: D
D for sure. Tested!
upvoted 1 times
...
Stavok
1 year, 8 months ago
Selected Answer: D
Correct answer is D A & B will show an error because : The method readLine() is undefined for the type FileReader. C will show an error because : Cannot invoke read() on the array type char[]
upvoted 1 times
...
Mukes877
1 year, 8 months ago
Selected Answer: D
readers.read() will return integer value So D is correct
upvoted 1 times
...
JGR_77
1 year, 10 months ago
Selected Answer: A
reader.readline doesn't exist
upvoted 1 times
JGR_77
1 year, 10 months ago
Sorry, maybe D, A only read int, and characters it's an char array
upvoted 1 times
...
...
Obalt
1 year, 12 months ago
The correct answer is D
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago