Oracle
1Z0-804 · Question #62
Given the code fragment: What is the result when the result.txt file already exists in c:\student?
The correct answer is B. The program replaces the file contents as well as the file attributes and prints Not equal. Assuming there is a file D:\\faculty\\report.txt then this file will be copied and will be replacing C:\\student\\report.txt.
NIO.2
Question
Given the code fragment:
What is the result when the result.txt file already exists in c:\student?
Exhibit
Options
- AThe program replaces the file contents and the file's attributes and prints Equal.
- BThe program replaces the file contents as well as the file attributes and prints Not equal.
- CAn UnsupportedOperationException is thrown at runtime.
- DThe program replaces only the file attributes and prints Not equal.
How the community answered
(49 responses)- A10% (5)
- B84% (41)
- C4% (2)
- D2% (1)
Explanation
Assuming there is a file D:\faculty\report.txt then this file will be copied and will be replacing C:\student\report.txt.
Topics
#Files.copy#REPLACE_EXISTING#file attributes#CopyOption
Community Discussion
No community discussion yet for this question.
