1z0-809 question 91 discussion

View all Java SE 8 Programmer II Exam here
back to oracle forum

Question 91

Given the content of the employee.txt file:
Every worker is a master.
Given that the employee.txt file is accessible and the file allemp.txt does NOT exist, and the code
fragment:

What is the result?

  • A. Exception 1
  • B. Exception 2
  • C. The program executes, does NOT affect the system, and produces NO output.
  • D. allemp.txt is created and the content of employee.txt is copied to it.
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
0 / 1000
vidhya
6 months, 3 weeks ago

option D because, files .write will write into the file allemp.txt, creates one if it doesnt exist.