0% found this document useful (0 votes)
90 views

Pass4Test: IT Certification Guaranteed, The Easy Way!

The document provides sample questions and explanations for the 1Z0-819 exam. It includes 20 multiple choice questions covering topics like Java lambda expressions, streams, I/O, annotations, and string manipulation.

Uploaded by

Rawand Bencib
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)
90 views

Pass4Test: IT Certification Guaranteed, The Easy Way!

The document provides sample questions and explanations for the 1Z0-819 exam. It includes 20 multiple choice questions covering topics like Java lambda expressions, streams, I/O, annotations, and string manipulation.

Uploaded by

Rawand Bencib
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/ 18

PASS4TEST

IT Certification Guaranteed, The Easy Way!

http://www.pass4test.com
We offer free update service for one year
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

Exam : 1z0-819

Title : Java SE 11 Developer

Vendor : Oracle

Version : DEMO

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 1


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

NO.1 Given the code fragment:


var pool = Executors.newFixedThreadPool(5);
Future outcome = pool.submit(() -> 1);
Which type of lambda expression is passed into submit()?
A. java.util.concurrent.Callable
B. java.util.function.Function
C. java.util.function.Predicate
D. java.lang.Runnable
Answer: A

NO.2 Why would you choose to use a peek operation instead of a forEach operation on a Stream?
A. to process the current item and return a stream
B. to process the current item and return void
C. to remove an item from the beginning of the stream
D. to remove an item from the end of the stream
Answer: A

NO.3 Given the code fragment:


What is the result?
A. [Kale, Lettuce]
[Salmon, Seabass]
B. [Lettuce, Kale]
[Seabass, Salmon]
C. [Lettuce, Kale]
D. A compilation error is thrown.
Answer: D

NO.4 Given:

What is the result?


A. 6=(x+y)=42
B. 6=(x+y)=6
C. 42=(x+y)=42
D. An exception is thrown at runtime.
E. 42=(x+y)=6

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 2


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

Answer: A
Explanation:

NO.5 Given:

And the command:


java Main Helloworld
What is the result ?
A. Input:
Echo: Helloworld
B. Input: Echo:
C. A NullPointerException is thrown at run time.
D. Input:
Then block until any input comes from System.in.
E. Input: Helloworld Echo: Helloworld
Answer: D
Explanation:

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 3


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

NO.6 Given:

and
checkQuality(QUALITY.A);
and

Which code fragment can be inserted into the switch statement to print Best?
A. QUALITY.A
B. QUALITY.ValueOf()

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 4


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

C. A
D. A.toString()
Answer: C

NO.7 Given:

You want to examine the items list it contains an item for which the variable count is below zero.
Which code fragment at line 1 accomplish this?
A. If (items.stream () .filter (i -> count < 0) . findAny () ) {
B. If (items.stream () .anymatch (i -> count < 0) < 0) ) {
C. If (items.stream () .filter (i -> count < 0) . findFirst () ) {
D. If (items.stream () .allmatch (i -> count < 0) < 0) ) {
Answer: C

NO.8 Given the code fragment:

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 5


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

What is the result?


A. The code prints nothing.
B. 0 4 9
C. 0 8
D. 0 8 10
E. 0
Answer: C
Explanation:

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 6


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

NO.9 Which code fragment compiles?

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 7


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

A. Option A
B. Option D
C. Option C
D. Option B
Answer: B
Explanation:

NO.10 Given:

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 8


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

You want to obtain the Stream object on reading the file. Which code inserted on line 1 will
accomplish this?
A. Stream lines = Files.readAllLines(Paths.get(INPUT_FILE_NAME));
B. Stream<String> lines = Files.lines(INPUT_FILE_NAME);
C. var lines = Files.readAllLines(Paths.get(INPUT_FILE_NAME));
D. var lines = Files.lines(Paths.get(INPUT_FILE_NAME));
Answer: C

NO.11 Given:

Which is true?
A. System.out is an instance of java.io.OutputStream by default.
B. System.in is the standard input stream. The stream is already open.
C. System.in cannot reassign the other stream.
D. System.out is the standard output stream. The stream is open only when System.out is called.
Answer: B

NO.12 Given the code fragment:

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 9


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

What is the result?


A. A java.lang.NullPointerException is thrown.
B. False
C. True
D. A java.lang, UnsupportedOperationException is thrown.
Answer: D

NO.13 Given:

What is the result?


A.

B.

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 10


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

C.

D.

Answer: D

NO.14 Given:

What is the result?


A. Map: 0 Keys: 0 Values: 0
B. Map: 0 Keys: 4 Values: 4
C. Map: 4 Keys: 4 Values: 4
D. The compilation fails.
E. Map: 4 Keys: 0 Values: 0
Answer: E

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 11


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

Explanation:

NO.15 Given:

What is the result?


A. Orange Juice
B. The program prints nothing.
C. Orange Juice Apple Pie Lemmon Ice Raspberry Tart
D. The compilation fails.
Answer: C
Explanation:

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 12


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

NO.16 Which code fragment added to line 1 enables the code to compile and print Hello Joe?
A.

B.

C.

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 13


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

D.

Answer: A

NO.17 Given:

Which annotation should be used to remove warnings from compilation?


A. @SuppressWarnings("unchecked") on main and @SafeVarargs on the print method
B. @SuppressWarnings("rawtypes") on main and @SafeVarargs on the print method
C. @SuppressWarnings on the main and print methods
D. @SuppressWarnings("all") on the main and print methods
Answer: A
Explanation:

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 14


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

NO.18 Which code fragment compiles?

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 15


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

A. Option B
B. Option A
C. Option D
D. Option C
Answer: C
Explanation:

NO.19 Given:

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 16


https://www.pass4test.com/1Z0-819.html
1Z0-819 Exam Questions, 1Z0-819 study materials. Java SE 11 Developer
IT Certification Guaranteed, The Easy Way!

What is the result?


A. The compilation fails.
B. Keys: 0 Values: 0 Map: 0
C. Keys: 0 Values: 0 Map:
D. Keys: 4 Values: 4 Map: 4
E. Keys: 4 Values: 4 Map: 0
Answer: D

NO.20 Given:

Which would cause s to be AQCD?


A. s.replace(s.indexOf("B"), s.indexOf("B"), "Q");
B. s.replace(s.indexOf("A"), s.indexOf("B"), "Q");
C. s.replace(s.indexOf("A"), s.indexOf("C"), "Q");
D. s.replace(s.indexOf("B"), s.indexOf("C"), "Q");
Answer: D

1Z0-819, 1Z0-819 dumps, Pass4Test 1Z0-819 17


https://www.pass4test.com/1Z0-819.html

You might also like