Logo Passei Direto
Material
Study with thousands of resources!

Text Material Preview

https://www.genuinedumps.com/1Z0-819-exam-questions.html
Oracle
1Z0-819
Java SE 11 Developer
QUESTION & ANSWERS
https://www.genuinedumps.com/1Z0-819-exam-questions.html
QUESTION 1
IntStream.rangeClosed(l, 100).map(FizzBuzz::convert).forEach(System.out::println);A.
IntStream.ranged, 100).map(FizzBuzz::convert).forEach(System.out::println);B.
intstream.rangeclosed(l, 100).mapToObj{FizzBuzz::convert).forEach(System.out::printIn);C.
IntStream.range(1, 100).mapToObj(FizzBuzz::convert).forEach(System.out::println);D.
Correct Answer: A
QUESTION 2
Your organization makes mlib.jar available to your cloud customers. While working on a code cleanup
project for mlib.jar, you see this method by customers:
What security measures should be added to this method so that it meets the requirements for a
customer accessible method?
A.
Create a method that validates the hostName and portNumber parameters before opening theB.
socket.
Make enableService private.C.
Enclose the call to new Socket In an AccessController.doPrivileged block.D.
Correct Answer: D
https://www.genuinedumps.com/1Z0-819-exam-questions.html
QUESTION 3
Which method throws an exception for not-a-number and infinite input values?
A.
B.
C.
D.
Correct Answer: A
QUESTION 4
Given:
String originalPath = “data\\projects\\a-project\\..\\..\\another-project”;
Path path = Paths.get(originalPath);
System.out.print(path.normalize());
What is the result?
data\another-project A.
data\projects\a-project\another-project B.
data\\projects\\a-project\\..\\..\\another-project C.
data\projects\a-project\..\..\another-project D.
Correct Answer: D
Explanation/Reference:
https://www.genuinedumps.com/1Z0-819-exam-questions.html
QUESTION 5
Given:
What is the result?
[0,0] = Red[0,1] = White[1,0] = Black[1,1] = Blue[2,0] = Yellow[2,1] = Green[3,0] = VioletA.
[0,0] = Red[1,0] = Black[2,0] = BlueB.
java.lang.ArrayIndexOutOfBoundsException thrownC.
[0,0] = Red[0,1] = White[1,0] = Black[2,0] = Blue[2,1] = Yellow[2,2] = Green[2,3] = VioletD.
https://www.genuinedumps.com/1Z0-819-exam-questions.html
Correct Answer: D
QUESTION 6
Which two commands are used to identify class and module dependencies? (Choose two.)
jmod describeA.
java Hello.javaB.
jdeps --list-depsC.
jar --show-module-resolutionD.
java --show-module-resolutionE.
Correct Answer: C,E
QUESTION 7
Given:
Which two lines can replace line 1 so that the Y class compiles? (Choose two.)
map.forEach((k, v) -> set(v)));A.
set(map.values());B.
super.set(List map)C.
super.set(map.values());D.
set(map)E.
https://www.genuinedumps.com/1Z0-819-exam-questions.html
Correct Answer: B,D
QUESTION 8
Which two statements are true about Java modules? (Choose two.)
Modular jars loaded from --module-path are automatic modules.A.
Any named module can directly access all classes in an automatic module.B.
Classes found in --classpath are part of an unnamed module.C.
Modular jars loaded from --classpath are automatic modules.D.
If a package is defined in both the named module and the unnamed module, then the package inE.
the unnamed module is ignored.
Correct Answer: A,C
QUESTION 9
Given:
What is the result?
is it 1A.
An IndexOutOfBoundsException is thrown at runtime.B.
is it 0C.
this is it 2D.
this is it 3
E.
https://www.genuinedumps.com/1Z0-819-exam-questions.html
Correct Answer: D
QUESTION 10
Given:
What is the result?
42A.
The compilation fails due to an error in line 4.B.
17C.
The compilation fails due to an error in line 3.D.
The compilation fails due to an error in line 2.E.
The compilation fails due to an error in line 1.F.
The compilation fails due to an error in line 5.G.
https://www.genuinedumps.com/1Z0-819-exam-questions.html
Correct Answer: A
QUESTION 11
Given:
 What is the result?
2134A.
234B.
2341C.
214D.
Correct Answer: A
QUESTION 12
Given:
https://www.genuinedumps.com/1Z0-819-exam-questions.html
Which two interfaces can be used in lambda expressions? (Choose two.)
MyInterface1A.
MyInterface3B.
MyInterface5C.
MyInterface2D.
MyInterface4E.
Correct Answer: C,D
QUESTION 13
Given:
https://www.genuinedumps.com/1Z0-819-exam-questions.html
What needs to change to make these classes compile and still handle all types of Interface Worker? 
Replace Line 3 with public void addProcess (Worker w) {. A.
Replace Line 1 with public class Main extends Thread {. B.
Replace Line 2 with private List processes = new ArrayList<>();. C.
Replace Line 3 with public void addProcess(T w) {. D.
Correct Answer: D
QUESTION 14
Given:
https://www.genuinedumps.com/1Z0-819-exam-questions.html
Which option should you choose to enable the code to print Something happened?
Add extends GeneralException on line 1.Add extends Exception on line 2.A.
Add extends SpecificException on line 1.Add extends GeneralException on line 2.B.
Add extends Exception on line 1.Add extends Exception on line 2.C.
Add extends Exception on line 1.Add extends GeneralException on line 2.D.
Correct Answer: D
QUESTION 15
What change will cause the code to compile successfully?
Insert PriceChecker (?) prod on line 1.A.
Insert PriceChecker <> prod on line 1.B.
Insert PriceChecker prod on line 1.C.
Insert PriceChecker prod on line 1.D.
Correct Answer: A
https://www.genuinedumps.com/1Z0-819-exam-questions.html
QUESTION 16
Given:
What is the result?
2134A.
2143B.
214C.
234
D.
Correct Answer: C
QUESTION 17
Which two statements are correct about modules in Java? (Choose two.)
java.base exports all of the Java platforms core packages.A.
https://www.genuinedumps.com/1Z0-819-exam-questions.html
module-info.java can be placed in any folder inside module-path.B.
A module must be declared in module-info.java file.C.
module-info.java cannot be empty.D.
By default, modules can access each other as long as they run in the same folder.E.
Correct Answer: A,C
QUESTION 18
Given:
What is the result?
Dr. WhoA.
Dr. NullB.
An exception is thrown at runtime.C.
nullD.
Correct Answer: D
https://www.genuinedumps.com/1Z0-819-exam-questions.html
Explanation/Reference:
QUESTION 19
Given:
/code/a/Test.java
containing:
and
/code/b/Best.java
containing:
package b;
public class Best { }
Which is the valid way to generate bytecode for all classes?
java /code/a/Test.javaA.
javac --d /code /code/a/TestB.
java /code/a/Test.java /code/b/Best.javaC.
java --cp /code a.TestD.
javac --d /code /code/a/Test.java /code/b/Best.javaE.
javac --d /code /code/a/Test.javaF.
Correct Answer: E
QUESTION 20
Given:
LocalDate d1 = LocalDate.of(1997,2,7);
DateTimeFormatter dtf =
DateTimeFormatter.ofPattern( /*insert code here*/ );
System.out.println(dtf.format (d1));
Which pattern formats the date as Friday 7th of February 1997?
https://www.genuinedumps.com/1Z0-819-exam-questions.html
''eeee dd+''th of''+ MMM yyyy''A.
''eeee dd'th of' MMM yyyy''B.
''eeee d+''th of''+ MMMM yyyy''C.
''eeee d'th of' MMMM yyyy''D.
Correct Answer: B
QUESTION 21
Given:
Which two changes need to be made to make this class compile? (Choose two.)
Change Line 1 to an abstract class:public abstract class API {A.
Change Line 2 access modifier to protected:protected void checkValue(Object value)throwsB.
IllegalArgumentException;
Change Line 1 to a class:public class API {C.
Change Line 1 to extend java.lang.AutoCloseable:public interface API extends AutoCloseable {D.
Change Line 2 to an abstract method:public abstract void checkValue(Object value)throwsE.
IllegalArgumentException;
Correct Answer: C,E
https://www.genuinedumps.com/1Z0-819-exam-questions.html
QUESTION 22
Which two expressions create a valid Java Path instance? (Choose two.) 
Paths.get("foo") A.
Paths.getPath("too") B.
Path.get(new URI("file:///domains/oracle/test.txt")) C.
new Path("foo") D.
Paths.get(URL.create("file:///domains/oracle/test.txt")) E.
Correct Answer: A,E
QUESTION 23
Which code fragment compiles?
A.
B.
C.
D.
Correct Answer: D
QUESTION 24
Given:
https://www.genuinedumps.com/1Z0-819-exam-questions.html
executed using this command:
java Myclass My Car isred
What is the output of this class?
Car--red--MyA.
My--Car--isB.
My--is--javaC.
java--Myclass--MyD.
Myclass--Car--redE.
Correct Answer: A
QUESTION 25
Which two are successful examples of autoboxing? (Choose two.)
String a = ''A'';A.
Integer e = 5;B.
Float g = Float.valueOf(null);C.
Double d = 4;D.
Long c = 23L;E.
Float f = 6.0;F.
Correct Answer: A,B
QUESTION 26
Which two modules include APIs in the Java SE Specification? (Choose two.)
java.loggingA.
java.desktopB.
javafxC.
jdk.httpserverD.
jdk.jartoolE.
https://www.genuinedumps.com/1Z0-819-exam-questions.html
Correct Answer: A,D