Oracle 1Z0-816 Certification Sample Questions and Answers

1Z0-816 PDF, 1Z0-816 Dumps PDF Free Download, 1Z0-816 Latest Dumps Free PDF, Java SE 11 Programmer II PDF DumpsThe Oracle Java SE 11 Programmer II (1Z0-816) Sample Question Set is designed to help you prepare for the Oracle Certified Professional - Java SE 11 Developer (OCP) certification exam. To become familiar with the actual Oracle Certification exam environment, we suggest you try our Sample Oracle 1Z0-816 Certification Practice Exam.

This Oracle Java SE 11 Programmer II certification sample practice test and sample question set are designed for evaluation purposes only. If you want to test your Oracle 1Z0-816 knowledge to identify your areas of improvement and get familiar with the actual exam format, we suggest you prepare with the Premium Oracle Certified Professional - Java SE 11 Developer (OCP) Certification Practice Exam. Our team of Oracle Java SE experts has designed Questions-Answers for this premium practice exam by collecting inputs from recently certified candidates. Our premium Oracle 1Z0-816 certification practice exam will boost your confidence as well as your actual Oracle Java SE 11 Programmer II exam result.

Oracle 1Z0-816 Sample Questions:

01. Which interface in the java.util.function package can return a primitive type?
a) ToDoubleFunction
b) Supplier
c) BiFunction
d) LongConsumer
02. Which two statements independently compile?
(Choose two.)
a) List<? super Short> list = new ArrayList<Number>();
b) List<? super Number> list = new ArrayList<Integer>();
c) List<? extends Number> list = new ArrayList<Byte>();
d) List<? extends Number> list = new ArrayList<Object>();
e) Listlist = new ArrayList();
03. Given the code fragment:
10. var lst = List.of(1, 2, 3, 4);
11. lst.replaceAll(x -> x + 100);
12. System.out.println(“-Completed-”);
Which action enables to print -Completed-?
a) Replacing line 10, with List<Integer> lst = List.of(1,2,3,4);
b) Replacing line 11, with lst.replaceAll(x = x + 100);
c) Replacing line 10, with var lst = Arrays.asList(1, 2, 3, 4);
d) Replacing line 11, with lst.forEach(x -> x + 100);
04. var numbers = List.of(0,1,2,3,4,5,6,7,8,9); You want to calculate the average of numbers. Which two codes will accomplish this?
(Choose two.)
a) double avg = −> a);
b) double avg = numbers.parallelStream().mapToInt (m −> m).average().getAsDouble();
c) double avg = (i −> i).average().parallel();
d) double avg =;
05. Given the code fragment:
Stream<Integer> numStream = Stream.of(10, 20, 30); -> n + 10).peek(s -> System.out.print(s));
numStream.forEach(s -> System.out.println(s));
What it the result?
a) 203040
b) 102030
c) 102030
d) An exception is thrown at runtime.
06. Which code fragment does a service use to load the service provider with a Print interface?
a) private Print print = com.service.Provider.getInstance();
b) private java.util.ServiceLoader loader = ServiceLoader.load(Print.class);
c) private java.util.ServiceLoader loader = new java.util.ServiceLoader<>();
d) private Print print = new com.service.Provider.PrintImpl();
07. Which two are guidelines for preventing denial of service attacks?
a) Release resources in all cases.
b) Resource limit checks should not suffer from numeric overflow.
c) Purge sensitive information from exceptions.
d) Validate file formats before processing untrusted files.
e) Make public static fields final.
f) Use mutable classes whenever possible.
08. Given these named modular JARs and their module-info java files order.jar:
module order {
requires product;
module product {
Which is the only possible result of executing the command jdeps -s order.jar product.jar?
a) order -> java.
baseorder -> product
product -> java.base
b) order -> product
c) product -> order
d) java.base -> product
java.base -> order
product -> order
09. Which two statements set the default locale used for formatting numbers, currency, and percentages?
(Choose two.)
a) Locale.setDefault(Locale.Category.FORMAT, “zh-CN”);
b) Locale.setDefault(Locale.Category.FORMAT, Locale.CANADA_FRENCH);
c) Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
d) Locale.setDefault(“en_CA”);
e) Locale.setDefault(“es”, Locale.US);
10. Given:
public class Client {
static void doCalc(byte... a) {
static void doCalc(long a, long b) {
System.out.print("long, long");
static void doCalc(Byte s1, Byte s2) {
System.out.print("Byte, Byte");
public static void main (String[] args) {
byte b = 5;
doCalc(b, b);
a) byte…
b) long, long
c) Byte, Byte
d) compilation error


Question: 01

Answer: a

Question: 02

Answer: a, c

Question: 03

Answer: c

Question: 04

Answer: b

Question: 05

Answer: d

Question: 06

Answer: b

Question: 07

Answer: a, b

Question: 08

Answer: a

Question: 09

Answer: b, d

Question: 10

Answer: b

Rating: 5 / 5 (80 votes)