Given:
Which two statements are true if the method is added to Bar? (Choose two.)
Which module-info.java is correct for a service provider for a print service defined in the PrintServiceAPI
module?
Given:
It is required that if p instanceof Pair then p.isValid() returns true.
Which is the smallest set of visibility changes to insure this requirement is met?
Given:
Which code fragment on line 1 makes the m map contain the employee with the highest salary for each neighborhood?
A)
B)
C)
D)
Given:
executed with this command:
java Main one two three
What is the output of this class?
Given the code fragment:
What change on line 1 will make this code compile?
Given:
public class X {
}
and
public final class Y extends X {
}
What is the result of compiling these two classes?
Given the declaration:
Examine this code fragment:
/* Loc1 */ class ProcessOrders { ... }
Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)
Which interface in the java.util.function package can return a primitive type?
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:
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 the code fragment:
You want to display the value of currency as $100.00.
Which code inserted on line 1 will accomplish this?
Given:
executed using command:
java Hello “Hello World” Hello World
What is the output?
Which two statements correctly describe capabilities of interfaces and abstract classes? (Choose two.)
Given:
What needs to change to make these classes compile and still handle all types of Interface Worker?
Given:
What code must you insert on Line 1 to enable the code to print Hello world?
Given:
What is the correct definition of the JsonField annotation that makes the Point class compile?
A)
B)
C)
Given the code fragment:
var pool = Executors.newFixedThreadPool(5);
Future outcome = pool.submit(() −> 1);
Which type of lambda expression is passed into submit()?
Analyze the code:
Which two options can you insert inside println method to produce Global:namescope? (Choose two.)
Given:
Which three actions implement Java SE security guidelines? (Choose three.)