Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

Oracle Java SE 11 Programmer II (1Z1-816) Free Practice Test

Question 1
Consider this method declaration:

A) "SET SESSION AUTHORIZATION " + user
B) "SET SESSION AUTHORIZATION " + stmt.enquoteIdentifier(user)
Is A or B the correct replacement for <EXPRESSION> and why?

Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 2
Given:
public class X {
}
and
public final class Y extends X {
}
What is the result of compiling these two classes?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
Given:

Assume the file on path does not exist. What is the result?

Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 4
Given:

What is the result?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 5
Given:

Which one is correct?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
Which three annotation uses are valid? (Choose three.)

Correct Answer: C,D,E
Question 7
Given the contents:
MessageBundle.properties file:
message=Hello
MessageBundle_en.properties file:
message=Hello (en)
MessageBundle_US.properties file:
message=Hello (US)
MessageBundle_en_US.properties file:
message=Hello (en_US)
MessageBundle_fr_FR.properties file:
message=Bonjour
and the code fragment:
Locale.setDefault(Locale.FRANCE);
Locale currentLocale = new Locale.Builder().setLanguage("en").build();
ResourceBundle messages = ResourceBundle.getBundle("MessageBundle", currentLocale); System.out. println(messages.getString("message")); Which file will display the content on executing the code fragment?

Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 8
A bookstore's sales are represented by a list of Sale objects populated with the name of the customer and the books they purchased.
public class Sale {
private String customer;
private List<Book> items;
// constructor, setters and getters not shown
}
public class Book {
private String name;
private double price;
// constructor, setters and getters not shown
}
Given a list of Sale objects, tList, which code fragment creates a list of total sales for each customer in ascending order?

Correct Answer: B