0% found this document useful (0 votes)
636 views11 pages

1Z0-819 Exam Questions

The document provides sample questions and answers for the Oracle 1Z0-819 Java SE 11 Developer certification exam. It includes 13 multiple choice questions covering topics like Java streams, lambda expressions, exceptions, and JDBC. The questions test knowledge of Java 8 and Java 11 features.

Uploaded by

MeredithBogisich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
636 views11 pages

1Z0-819 Exam Questions

The document provides sample questions and answers for the Oracle 1Z0-819 Java SE 11 Developer certification exam. It includes 13 multiple choice questions covering topics like Java streams, lambda expressions, exceptions, and JDBC. The questions test knowledge of Java 8 and Java 11 features.

Uploaded by

MeredithBogisich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Oracle

1Z0-819
Java SE 11 Developer
QUESTION & ANSWERS

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
QUESTION 1

Given the code fragment:

Which code fragment replaces the for statement?


A. IntStream.rangeClosed(l, 100).map(FizzBuzz::convert).forEach(System.out::println);
B. IntStream.ranged, 100).map(FizzBuzz::convert).forEach(System.out::println);
C. intstream.rangeclosed(l, 100).mapToObj{FizzBuzz::convert).forEach(System.out::printIn);
D. IntStream.range(1, 100).mapToObj(FizzBuzz::convert).forEach(System.out::println);

Correct Answer: A

QUESTION 2

Why does this compilation fail?


A. The method Y. print (object) does not call the method super.print (object)
B. The method x. print (object) is not accessible to Y
C. In method x. print (Collection), system. Out :: prints is an invalid Java identifier.
D. The method print (object) and the method print (object...) are duplicates of each other.
E. The method Y. print (object...) cannot override the final method x.print (object.).

Correct Answer: D

QUESTION 3

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 items;
// constructor, setters and getters not shown
https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
}
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?

A.

B.

C.

D.

Correct Answer: C

QUESTION 4

Which code is correct?


A. Runnable r = ''Message'' > System.out.println();
B. Runnable r = () > System.out::print;
C. Runnable r = () -> {System.out.println(''Message'');};
D. Runnable r = > System.out.println(''Message'');
E. Runnable r = {System.out.println(''Message'')};

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
Correct Answer: C

QUESTION 5

Given:
var data = new ArrayList<>();
data.add(''Peter'');
data.add(30); data.add(''Market
Road''); data.set(1, 25);
data.remove(2);
data.set(3, 1000L);
System.out.print(data);
What is the output?
A. [Market Road, 1000]
B. [Peter, 30, Market Road]
C. [Peter, 25, null, 1000]
D. An exception is thrown at run time.

Correct Answer: D

QUESTION 6

Given:

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
Which two lines cause compilation errors? (Choose two.)
A. line 12
B. line 6
C. line 9
D. line 8
E. line 7

Correct Answer: B,E

QUESTION 7

Given:

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
Which two interfaces can be used in lambda expressions? (Choose two.)
A. MyInterface1
B. MyInterface3
C. MyInterface5
D. MyInterface2
E. MyInterface4

Correct Answer: C,D

QUESTION 8

Given:

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
What is the result?
A. The compilation fails.
B. 1.99,2.99,0
C. 1.99,2.99,0.0
D. 1.99,2.99

Correct Answer: A

QUESTION 9

Given:
var fruits = List.of(''apple'', ''orange'', ''banana'', ''lemon'');
You want to examine the first element that contains the character n. Which statement will accomplish
this?
A. String result = fruits.stream().filter(f > f.contains(''n'')).findAny();
B. fruits.stream().filter(f > f.contains(''n'')).forEachOrdered(System.out::print);
C. Optional result = fruits.stream().filter(f > f.contains (''n'')).findFirst ();
D. Optional result = fruits.stream().anyMatch(f > f.contains(''n''));

Correct Answer: B

QUESTION 10

A company has an existing Java app that includes two Java 8 jar files, sales-3.10. jar and clients-
10.2.jar.
The jar file ,sales -8, 10, jar reference packages in clients -10.2 jar, but clients-10.2 jar does not
reference packages in sales -8.10, jar.

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
They have decided to modularize clients-10.2.jar.
Which module-info. Java file would work for the new library version clients-10.3 jar?

A.

B.

C.

D.

Correct Answer: C

QUESTION 11

Given:

Which is true?
A. The compilation fails due to an error in line 6.
B. The compilation succeeds.
C. The compilation fails due to an error in line 4.
D. The compilation fails due to an error in line 10.
E. The compilation fails due to an error in line 7.
F. The compilation fails due to an error in line 9.
G. The compilation fails due to an error in line 2.

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
Correct Answer: A

QUESTION 12

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.

Correct Answer: D

QUESTION 13

Given the Customer table structure:


* ID Number Primary Key
* NAME Text
Nullable Given code
fragment:

Which statement inserted on line 14 sets NAME column to a NULL value?


A. Stmt.setNull(2, java,sql. Types, VARCHAR);

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
B. Stmt.setNull(2 string, class);

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html
C. Stmt.setNull(2, null);
D. Stmt.setNull(2, java.lang, string);

Correct Answer: A

https://www.certscollege.com/oracle-1Z0-819-exam-dumps.html

You might also like