Given the code fragment:
Path currentFile = Paths.get(“/scratch/exam/temp.txt”);
Path outputFile = Paths get(“/scratch/exam/new.txt”);
Path directory = Paths.get(“/scratch/”);
Files.copy(currentFile, outputFile);
Files.copy(outputFile, directory);
Files.delete (outputFile);
The /scratch/exam/temp.txt file exists. The /scratch/exam/new.txt and /scratch/new.txt files do not exist.
What is the result?
Correct Answer:
C
🗳️
Which two are functional interfaces? (Choose two.)
Correct Answer:
CE
🗳️
Given the declaration:
Examine this code fragment:
/* Loc1 */ class ProcessOrders { ... }
Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)
Correct Answer:
AB
🗳️
Given:
Which two interfaces can be used in lambda expressions? (Choose two.)
Correct Answer:
CD
🗳️