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?
Given:
List
List
Which code fragment correctly forms a short list of words containing the letter “e�
Given:
A) An exception is thrown at run time.
B)
C) The compilation fails due to an error on line 2.
D) The compilation fails due to an error on line 1.
E)
F)
The compilation fails due to an error on line 3.
Given these two classes:
And given this fragment:
Which describes the fragment?
Given:
Which two independent changes will make the Main class compile? (Choose two.)
Given:
What is the correct definition of the JsonField annotation that makes the Point class compile?
A)
B)
C)
You are working on a functional bug in a tool used by your development organization. In your investigation, you find that the tool is executed with a security policy file containing this grant.
What action should you take?
Given the code fragment:
Path source = Paths.get(“/repo/a/a.txtâ€);
Path destination = Paths.get(“/repoâ€);
Files.move(source, destination); // line 1
Files.delete (source); // line 2
Assuming the source file and destination folder exist, what Is the result?
Given:
Which three classes successfully override printOne()? (Choose three.)
Given:
Which two changes need to be made to make this class compile? (Choose two.)
Given this requirement:
Module vehicle depends on module part and makes its com.vehicle package available for all other modules.
Which module-info.java declaration meets the requirement?
Which two statements correctly describe capabilities of interfaces and abstract classes? (Choose two.)
Given:
Which two statements can be added at line 1 in Bar to successfully compile it? (Choose two.)
Given:
You want the code to produce this output:
John
Joe
Jane
Which code fragment should be inserted on line 1 and line 2 to produce the output?
Given:
and
checkQuality(QUALITY.A);
and
Which code fragment can be inserted into the switch statement to print Best?
Given:
You want to obtain the Stream object on reading the file. Which code inserted on line 1 will accomplish this?
Given:
public class X {
}
and
public final class Y extends X {
}
What is the result of compiling these two classes?