Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

1z0-819_3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 47

We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible

https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Oracle
Exam Questions 1Z0-819
Java SE 11 Developer

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 1
Given:

Which two allow a.Main to allocate a new Person? (Choose two.)

A. In Line 1, change the access modifier to privateprivate Person() {


B. In Line 1, change the access modifier to publicpublic Person() {
C. In Line 2, add extends Person to the Main classpublic class Main extends Person {and change Line 3 to create a new Main objectPerson person = new Main();
D. In Line 2, change the access modifier to protectedprotected class Main {
E. In Line 1, remove the access modifierPerson() {

Answer: BC

NEW QUESTION 2
Which two commands are used to identify class and module dependencies? (Choose two.)

A. jmod describe
B. java Hello.java
C. jdeps --list-deps
D. jar --show-module-resolution
E. java --show-module-resolution

Answer: CE

NEW QUESTION 3
Which two statements are true about the modular JDK? (Choose two.)

A. The foundational APIs of the Java SE Platform are found in the java.base module.
B. An application must be structured as modules in order to run on the modular JDK.
C. It is possible but undesirable to configure modules’ exports from the command line.
D. APIs are deprecated more aggressively because the JDK has been modularized.

Answer: AC

NEW QUESTION 4
Given:

What is the result?

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

Answer: C

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Explanation:

NEW QUESTION 5
Given:

Which loop incurs a compile time error?

A. the loop starting line 11


B. the loop starting line 7
C. the loop starting line 14
D. the loop starting line 3

Answer: C

NEW QUESTION 6
Given the code fragment:
Path currentFile = Paths.get(“/scratch/exam/temp.txt”); Path outputFile = Paths get(“/scratch/exam/new.txt”); Path directory = Paths.get(“/scratch/”);
Files.copy(currentFile, outputFile); Files.copy(outputFile, directory);
Files.delete (outputFile);
The /scratch/exam/temp.txt file exists. The /scratch/exam/new.txt and /scratch/new.txt files do not exist. What is the result?

A. /scratch/exam/new.txt and /scratch/new.txt are deleted.


B. The program throws a FileaAlreadyExistsException.
C. The program throws a NoSuchFileException.
D. A copy of /scratch/exam/new.txt exists in the /scratch directory and /scratch/exam/new.txt is deleted.

Answer: C

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 7
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.

Answer: A

NEW QUESTION 8
Given:

What is the result?

A. null
B. nothing
C. It fails to compile.
D. java.lang.IllegalAccessException is thrown.
E. Student

Answer: C

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 9
Given:

What is the result?

A. 6910 3
B. 10126 3
C. 3
D. 6104 3

Answer: D

Explanation:

NEW QUESTION 10
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

You want the code to produce this output:


John
Joe Jane
Which code fragment should be inserted on line 1 and line 2 to produce the output?

A. Insert Comparator<Person> on line 1.Insertpublic int compare(Person p1, Person p2) { return p1.name.compare(p2.name);}on line 2.
B. Insert Comparator<Person> on line 1.Insertpublic int compareTo(Person person) { return person.name.compareTo(this.name);}on line 2.
C. Insert Comparable<Person> on line 1.Insertpublic int compare(Person p1, Person p2) { return p1.name.compare(p2.name);}on line 2.
D. Insert Comparator<Person> on line 1.Insertpublic int compare(Person person) { return person.name.compare(this.name);}on line 2.

Answer: B

NEW QUESTION 10
Which command line runs the main class com.acme.Main from the module com.example?

A. java --module-path mods com.example/com.acme.Main


B. java –classpath com.example.jar com.acme.Main
C. java --module-path mods -m com.example/com.acme.Main
D. java -classpath com.example.jar –m com.example/com.acme.Main

Answer: D

NEW QUESTION 11
Given:

What is the expected result of javac?

A. javac fails to compile the class and prints the error message, C:\workspace4\Mycar.java:1:error: packagejava does not exist
B. javac compiles Mycar.java without errors or warnings.
C. javac fails to compile the class and prints the error message, C:\workspace4\Mycar.java:1:error: expected import java.lang
D. javac fails to compile the class and prints the error message, Error: Could not find or load main class Mycar.class

Answer: B

NEW QUESTION 12
Given the formula to calculate a monthly mortgage payment:

and these declarations:

How can you code the formula?

A. m = p * (r * Math.pow(1 + r, n) / (Math.pow(1 + r, n) - 1));


B. m = p * ((r * Math.pow(1 + r, n) / (Math.pow(1 + r, n)) - 1));
C. m = p * r * Math.pow(1 + r, n) / Math.pow(1 + r, n) - 1;
D. m = p * (r * Math.pow(1 + r, n) / Math.pow(1 + r, n) - 1);

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Answer: A

NEW QUESTION 17
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.lang.Runnable
B. java.util.function.Predicate
C. java.util.function.Function
D. java.util.concurrent.Callable

Answer: D

NEW QUESTION 20
Given:

Which code, when inserted at one or more marked positions, would allow classes B and C to compile?

A. @Override // position 3void x () {} // position 3@Override // position 3public void z() { } // position 3
B. @Override // position 2public void z() { } // position 3
C. implements A // position 1@Override // position 2
D. public void z() { } // position 3

Answer: B

NEW QUESTION 21
Given:

What is the result?

A. An exception is thrown at runtim


B. 42=(x+y)=42
C. 42=(x+y)=6
D. 6=(x+y)=42
E. 6=(x+y)=6

Answer: D

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 23
Given:

executed using this command: java Myclass My Car is red What is the output of this class?

A. Car--red--My
B. My--Car--is
C. My--is--java
D. java--Myclass--My
E. Myclass--Car--red

Answer: A

NEW QUESTION 28
Given:

What is the output?

A. 300
B. Exception
C. 200
D. 100

Answer: A

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 30
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. 2134
B. 2143
C. 214
D. 234

Answer: C

Explanation:

NEW QUESTION 34
Given:

What is the result?

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

A. D
B. Who
C. D
D. Null
E. An exception is thrown at runtime.
F. null

Answer: D

Explanation:

NEW QUESTION 35
Given:

Which two lines can replace line 1 so that the Y class compiles? (Choose two.)

A. map.forEach((k, v) -> set(v)));


B. set(map.values());
C. super.set(List<String> map)
D. super.set(map.values());
E. set(map)

Answer: BD

NEW QUESTION 38
Given the code fragment:

What is the result?

A. false true true


B. true false false
C. false false true
D. false true false

Answer: D

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 41
Given the code fragment:

What is the result?

A. ab cd ef
B. An ArrayIndexOutOfBoundsException is thrown at runtime.
C. The compilation fails.
D. abc def
E. ad be cf

Answer: E

NEW QUESTION 46
Given:

Which two lines cause compilation errors? (Choose two.)

A. line 12
B. line 6
C. line 9
D. line 8
E. line 7

Answer: BE

NEW QUESTION 47
Given:

Which two are correct? (Choose two.)

A. The output will be exactly 2 1 3 4 5.


B. The program prints 1 4 2 3, but the order is unpredictable.
C. Replacing forEach() with forEachOrdered(), the program prints 2 1 3 4 5, but the order is unpredictable.
D. Replacing forEach() with forEachOrdered(), the program prints 1 2 3 4 5.
E. Replacing forEach() with forEachOrdered(), the program prints 2 1 3 4 5.

Answer: BD

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 50
Examine these module declarations:

Which two statements are correct? (Choose two.)

A. The ServiceProvider module is the only module that, at run time, can provide the com.example.api API.
B. The placement of the com.example.api API in a separate module, ServiceAPI, makes it easy to install multiple provider modules.
C. The Consumer module should require the ServiceProvider module.
D. The ServiceProvider module should export the com.myimpl package.
E. The ServiceProvider module does not know the identity of a module (such as Consumer) that uses the com.example.api API.

Answer: AC

NEW QUESTION 53
Given the code fragment:

What is the result?

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

A. 01
B. 1
C. The program prints nothing.
D. It prints 1 in the infinite loop.

Answer: D

NEW QUESTION 57
Which statement about a functional interface is true?

A. It must be defined with the public access modifier.


B. It must be annotated with @FunctionalInterface.
C. It is declared with a single abstract method.
D. It is declared with a single default method.
E. It cannot have any private methods and static methods.

Answer: C

NEW QUESTION 61
Given:
String originalPath = “data\\projects\\a-project\\..\\..\\another-project”; Path path = Paths.get(originalPath); System.out.print(path.normalize());
What is the result?

A. data\another-project
B. data\projects\a-project\another-project
C. data\\projects\\a-project\\..\\..\\another-project
D. data\projects\a-project\..\..\another-project

Answer: D

Explanation:

NEW QUESTION 64
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. null
B. Joe Bloggs
C. The compilation fails due to an error in line 1.
D. p1

Answer: C

Explanation:

NEW QUESTION 66
Which two are successful examples of autoboxing? (Choose two.)

A. String a = “A”;
B. Integer e = 5;
C. Float g = Float.valueOf(null);
D. Double d = 4;
E. Long c = 23L;
F. Float f = 6.0;

Answer: AB

NEW QUESTION 71
Given:

This code results in a compilation error.


Which code should be inserted on line 1 for a successful compilation?

A. Consumer consumer = msg -> { return System.out.print(msg); };


B. Consumer consumer = var arg > {System.out.print(arg);};
C. Consumer consumer = (String args) > System.out.print(args);
D. Consumer consumer = System.out::print;

Answer: D

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 75
Given:

What is the result?

A. NullPointerException is thrown at line 4.


B. NullPointerException is thrown at line 10.
C. A compilation error occurs.
D. Hello

Answer: D

Explanation:

NEW QUESTION 76
Which two statements are true about Java modules? (Choose two.)

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

A. Modular jars loaded from --module-path are automatic modules.


B. Any named module can directly access all classes in an automatic module.
C. Classes found in –classpath are part of an unnamed module.
D. Modular jars loaded from –classpath are automatic modules.
E. If a package is defined in both the named module and the unnamed module, then the package in the unnamed module is ignored.

Answer: AC

NEW QUESTION 78
Given this requirement:
Module vehicle depends on module part and makes its com.vehicle package available for all other modules. Which module-info.java declaration meets the
requirement?

A. Option A
B. Option B
C. Option C
D. Option D

Answer: A

NEW QUESTION 80
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. A ClassCastException is thrown at runtime.


B. AnotherClass#methodA()AnotherClass#methodA()
C. The compilation fails.
D. SomeClass#methodA()AnotherClass#methodA()
E. AnotherClass#methodA()SomeClass#methodA()
F. SomeClass#methodA()SomeClass#methodA()

Answer: C

Explanation:

NEW QUESTION 81
Which statement about access modifiers is correct?

A. An instance variable can be declared with the static modifier.


B. A local variable can be declared with the final modifier.
C. An abstract method can be declared with the private modifier.
D. An inner class cannot be declared with the public modifier.
E. An interface can be declared with the protected modifier.

Answer: B

NEW QUESTION 84
Analyze the code:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Which two options can you insert inside println method to produce Global:namescope? (Choose two.)

A. Test.prefix+Test.name
B. new Test().prefix+new Test().name
C. Test.prefix+Test.getName()
D. Test.getName+prefix
E. prefix+Test.name
F. prefix+name

Answer: BC

NEW QUESTION 87
Given:

and:

Which code, when inserted on line 10, prints the number of unique localities from the roster list?

A. .map(Employee::getLocality).distinct().count();
B. map(e > e.getLocality()).count();
C. .map(e > e.getLocality()).collect(Collectors.toSet()).count();
D. .filter(Employee::getLocality).distinct().count();

Answer: D

NEW QUESTION 89
Given:

Which is true about line 1?

A. If the value is not present, a NoSuchElementException is thrown at run time.


B. It always executes the System.out::print statement.
C. If the value is not present, a NullPointerException is thrown at run time.
D. If the value is not present, nothing is done.

Answer: D

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 91
Given:

What is the result?

A. The compilation fails.


B. abdf
C. abd
D. adf
E. abcd

Answer: E

NEW QUESTION 95
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. 42
B. The compilation fails due to an error in line 4.
C. 17
D. The compilation fails due to an error in line 3.
E. The compilation fails due to an error in line 2.
F. The compilation fails due to an error in line 1.
G. The compilation fails due to an error in line 5.

Answer: A

NEW QUESTION 100


Which two modules include APIs in the Java SE Specification? (Choose two.)

A. java.logging
B. java.desktop
C. javafx
D. jdk.httpserver
E. jdk.jartool

Answer: AD

NEW QUESTION 104


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?

A. MessageBundle_en_US.properties
B. MessageBundle_en.properties
C. MessageBundle_fr_FR.properties
D. MessageBundle_US.properties
E. MessageBundle.properties

Answer: C

NEW QUESTION 107


Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. nothing
B. 10
C. 0 4 9

Answer: A

NEW QUESTION 112


Given:

and

What is the result?

A. A NullPointerException is thrown at run time.


B. The compilation fails.
C. 1Null null
D. 111
E. A ClassCastException is thrown at run time.

Answer: B

Explanation:

NEW QUESTION 115


Given this enum declaration:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Examine this code: System.out.println(Alphabet.getFirstLetter());


What code should be written at line 3 to make this code print A?

A. final String getFirstLetter() { return A.toString(); }


B. static String getFirstLetter() { return Alphabet.values()[1].toString(); }
C. static String getFirstLetter() { return A.toString(); }
D. String getFirstLetter() { return A.toString(); }

Answer: C

NEW QUESTION 120


......

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

About Exambible

Your Partner of IT Exam

Found in 1998

Exambible is a company specialized on providing high quality IT exam practice study materials, especially Cisco CCNA, CCDA,
CCNP, CCIE, Checkpoint CCSE, CompTIA A+, Network+ certification practice exams and so on. We guarantee that the
candidates will not only pass any IT exam at the first attempt but also get profound understanding about the certificates they have
got. There are so many alike companies in this industry, however, Exambible has its unique advantages that other companies could
not achieve.

Our Advances

* 99.9% Uptime
All examinations will be up to date.
* 24/7 Quality Support
We will provide service round the clock.
* 100% Pass Rate
Our guarantee that you will pass the exam.
* Unique Gurantee
If you do not pass the exam at the first time, we will not only arrange FULL REFUND for you, but also provide you another
exam of your claim, ABSOLUTELY FREE!

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 1
Given:

Which two allow a.Main to allocate a new Person? (Choose two.)

A. In Line 1, change the access modifier to privateprivate Person() {


B. In Line 1, change the access modifier to publicpublic Person() {
C. In Line 2, add extends Person to the Main classpublic class Main extends Person {and change Line 3 to create a new Main objectPerson person = new Main();
D. In Line 2, change the access modifier to protectedprotected class Main {
E. In Line 1, remove the access modifierPerson() {

Answer: BC

NEW QUESTION 2
Which two commands are used to identify class and module dependencies? (Choose two.)

A. jmod describe
B. java Hello.java
C. jdeps --list-deps
D. jar --show-module-resolution
E. java --show-module-resolution

Answer: CE

NEW QUESTION 3
Which two statements are true about the modular JDK? (Choose two.)

A. The foundational APIs of the Java SE Platform are found in the java.base module.
B. An application must be structured as modules in order to run on the modular JDK.
C. It is possible but undesirable to configure modules’ exports from the command line.
D. APIs are deprecated more aggressively because the JDK has been modularized.

Answer: AC

NEW QUESTION 4
Given:

What is the result?

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

Answer: C

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Explanation:

NEW QUESTION 5
Given:

Which loop incurs a compile time error?

A. the loop starting line 11


B. the loop starting line 7
C. the loop starting line 14
D. the loop starting line 3

Answer: C

NEW QUESTION 6
Given the code fragment:
Path currentFile = Paths.get(“/scratch/exam/temp.txt”); Path outputFile = Paths get(“/scratch/exam/new.txt”); Path directory = Paths.get(“/scratch/”);
Files.copy(currentFile, outputFile); Files.copy(outputFile, directory);
Files.delete (outputFile);
The /scratch/exam/temp.txt file exists. The /scratch/exam/new.txt and /scratch/new.txt files do not exist. What is the result?

A. /scratch/exam/new.txt and /scratch/new.txt are deleted.


B. The program throws a FileaAlreadyExistsException.
C. The program throws a NoSuchFileException.
D. A copy of /scratch/exam/new.txt exists in the /scratch directory and /scratch/exam/new.txt is deleted.

Answer: C

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 7
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.

Answer: A

NEW QUESTION 8
Given:

What is the result?

A. null
B. nothing
C. It fails to compile.
D. java.lang.IllegalAccessException is thrown.
E. Student

Answer: C

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 9
Given:

What is the result?

A. 6910 3
B. 10126 3
C. 3
D. 6104 3

Answer: D

Explanation:

NEW QUESTION 10
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

You want the code to produce this output:


John
Joe Jane
Which code fragment should be inserted on line 1 and line 2 to produce the output?

A. Insert Comparator<Person> on line 1.Insertpublic int compare(Person p1, Person p2) { return p1.name.compare(p2.name);}on line 2.
B. Insert Comparator<Person> on line 1.Insertpublic int compareTo(Person person) { return person.name.compareTo(this.name);}on line 2.
C. Insert Comparable<Person> on line 1.Insertpublic int compare(Person p1, Person p2) { return p1.name.compare(p2.name);}on line 2.
D. Insert Comparator<Person> on line 1.Insertpublic int compare(Person person) { return person.name.compare(this.name);}on line 2.

Answer: B

NEW QUESTION 10
Which command line runs the main class com.acme.Main from the module com.example?

A. java --module-path mods com.example/com.acme.Main


B. java –classpath com.example.jar com.acme.Main
C. java --module-path mods -m com.example/com.acme.Main
D. java -classpath com.example.jar –m com.example/com.acme.Main

Answer: D

NEW QUESTION 11
Given:

What is the expected result of javac?

A. javac fails to compile the class and prints the error message, C:\workspace4\Mycar.java:1:error: packagejava does not exist
B. javac compiles Mycar.java without errors or warnings.
C. javac fails to compile the class and prints the error message, C:\workspace4\Mycar.java:1:error: expected import java.lang
D. javac fails to compile the class and prints the error message, Error: Could not find or load main class Mycar.class

Answer: B

NEW QUESTION 12
Given the formula to calculate a monthly mortgage payment:

and these declarations:

How can you code the formula?

A. m = p * (r * Math.pow(1 + r, n) / (Math.pow(1 + r, n) - 1));


B. m = p * ((r * Math.pow(1 + r, n) / (Math.pow(1 + r, n)) - 1));
C. m = p * r * Math.pow(1 + r, n) / Math.pow(1 + r, n) - 1;
D. m = p * (r * Math.pow(1 + r, n) / Math.pow(1 + r, n) - 1);

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Answer: A

NEW QUESTION 17
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.lang.Runnable
B. java.util.function.Predicate
C. java.util.function.Function
D. java.util.concurrent.Callable

Answer: D

NEW QUESTION 20
Given:

Which code, when inserted at one or more marked positions, would allow classes B and C to compile?

A. @Override // position 3void x () {} // position 3@Override // position 3public void z() { } // position 3
B. @Override // position 2public void z() { } // position 3
C. implements A // position 1@Override // position 2
D. public void z() { } // position 3

Answer: B

NEW QUESTION 21
Given:

What is the result?

A. An exception is thrown at runtim


B. 42=(x+y)=42
C. 42=(x+y)=6
D. 6=(x+y)=42
E. 6=(x+y)=6

Answer: D

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 23
Given:

executed using this command: java Myclass My Car is red What is the output of this class?

A. Car--red--My
B. My--Car--is
C. My--is--java
D. java--Myclass--My
E. Myclass--Car--red

Answer: A

NEW QUESTION 28
Given:

What is the output?

A. 300
B. Exception
C. 200
D. 100

Answer: A

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 30
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. 2134
B. 2143
C. 214
D. 234

Answer: C

Explanation:

NEW QUESTION 34
Given:

What is the result?

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

A. D
B. Who
C. D
D. Null
E. An exception is thrown at runtime.
F. null

Answer: D

Explanation:

NEW QUESTION 35
Given:

Which two lines can replace line 1 so that the Y class compiles? (Choose two.)

A. map.forEach((k, v) -> set(v)));


B. set(map.values());
C. super.set(List<String> map)
D. super.set(map.values());
E. set(map)

Answer: BD

NEW QUESTION 38
Given the code fragment:

What is the result?

A. false true true


B. true false false
C. false false true
D. false true false

Answer: D

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 41
Given the code fragment:

What is the result?

A. ab cd ef
B. An ArrayIndexOutOfBoundsException is thrown at runtime.
C. The compilation fails.
D. abc def
E. ad be cf

Answer: E

NEW QUESTION 46
Given:

Which two lines cause compilation errors? (Choose two.)

A. line 12
B. line 6
C. line 9
D. line 8
E. line 7

Answer: BE

NEW QUESTION 47
Given:

Which two are correct? (Choose two.)

A. The output will be exactly 2 1 3 4 5.


B. The program prints 1 4 2 3, but the order is unpredictable.
C. Replacing forEach() with forEachOrdered(), the program prints 2 1 3 4 5, but the order is unpredictable.
D. Replacing forEach() with forEachOrdered(), the program prints 1 2 3 4 5.
E. Replacing forEach() with forEachOrdered(), the program prints 2 1 3 4 5.

Answer: BD

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 50
Examine these module declarations:

Which two statements are correct? (Choose two.)

A. The ServiceProvider module is the only module that, at run time, can provide the com.example.api API.
B. The placement of the com.example.api API in a separate module, ServiceAPI, makes it easy to install multiple provider modules.
C. The Consumer module should require the ServiceProvider module.
D. The ServiceProvider module should export the com.myimpl package.
E. The ServiceProvider module does not know the identity of a module (such as Consumer) that uses the com.example.api API.

Answer: AC

NEW QUESTION 53
Given the code fragment:

What is the result?

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

A. 01
B. 1
C. The program prints nothing.
D. It prints 1 in the infinite loop.

Answer: D

NEW QUESTION 57
Which statement about a functional interface is true?

A. It must be defined with the public access modifier.


B. It must be annotated with @FunctionalInterface.
C. It is declared with a single abstract method.
D. It is declared with a single default method.
E. It cannot have any private methods and static methods.

Answer: C

NEW QUESTION 61
Given:
String originalPath = “data\\projects\\a-project\\..\\..\\another-project”; Path path = Paths.get(originalPath); System.out.print(path.normalize());
What is the result?

A. data\another-project
B. data\projects\a-project\another-project
C. data\\projects\\a-project\\..\\..\\another-project
D. data\projects\a-project\..\..\another-project

Answer: D

Explanation:

NEW QUESTION 64
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. null
B. Joe Bloggs
C. The compilation fails due to an error in line 1.
D. p1

Answer: C

Explanation:

NEW QUESTION 66
Which two are successful examples of autoboxing? (Choose two.)

A. String a = “A”;
B. Integer e = 5;
C. Float g = Float.valueOf(null);
D. Double d = 4;
E. Long c = 23L;
F. Float f = 6.0;

Answer: AB

NEW QUESTION 71
Given:

This code results in a compilation error.


Which code should be inserted on line 1 for a successful compilation?

A. Consumer consumer = msg -> { return System.out.print(msg); };


B. Consumer consumer = var arg > {System.out.print(arg);};
C. Consumer consumer = (String args) > System.out.print(args);
D. Consumer consumer = System.out::print;

Answer: D

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 75
Given:

What is the result?

A. NullPointerException is thrown at line 4.


B. NullPointerException is thrown at line 10.
C. A compilation error occurs.
D. Hello

Answer: D

Explanation:

NEW QUESTION 76
Which two statements are true about Java modules? (Choose two.)

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

A. Modular jars loaded from --module-path are automatic modules.


B. Any named module can directly access all classes in an automatic module.
C. Classes found in –classpath are part of an unnamed module.
D. Modular jars loaded from –classpath are automatic modules.
E. If a package is defined in both the named module and the unnamed module, then the package in the unnamed module is ignored.

Answer: AC

NEW QUESTION 78
Given this requirement:
Module vehicle depends on module part and makes its com.vehicle package available for all other modules. Which module-info.java declaration meets the
requirement?

A. Option A
B. Option B
C. Option C
D. Option D

Answer: A

NEW QUESTION 80
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. A ClassCastException is thrown at runtime.


B. AnotherClass#methodA()AnotherClass#methodA()
C. The compilation fails.
D. SomeClass#methodA()AnotherClass#methodA()
E. AnotherClass#methodA()SomeClass#methodA()
F. SomeClass#methodA()SomeClass#methodA()

Answer: C

Explanation:

NEW QUESTION 81
Which statement about access modifiers is correct?

A. An instance variable can be declared with the static modifier.


B. A local variable can be declared with the final modifier.
C. An abstract method can be declared with the private modifier.
D. An inner class cannot be declared with the public modifier.
E. An interface can be declared with the protected modifier.

Answer: B

NEW QUESTION 84
Analyze the code:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Which two options can you insert inside println method to produce Global:namescope? (Choose two.)

A. Test.prefix+Test.name
B. new Test().prefix+new Test().name
C. Test.prefix+Test.getName()
D. Test.getName+prefix
E. prefix+Test.name
F. prefix+name

Answer: BC

NEW QUESTION 87
Given:

and:

Which code, when inserted on line 10, prints the number of unique localities from the roster list?

A. .map(Employee::getLocality).distinct().count();
B. map(e > e.getLocality()).count();
C. .map(e > e.getLocality()).collect(Collectors.toSet()).count();
D. .filter(Employee::getLocality).distinct().count();

Answer: D

NEW QUESTION 89
Given:

Which is true about line 1?

A. If the value is not present, a NoSuchElementException is thrown at run time.


B. It always executes the System.out::print statement.
C. If the value is not present, a NullPointerException is thrown at run time.
D. If the value is not present, nothing is done.

Answer: D

Explanation:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

NEW QUESTION 91
Given:

What is the result?

A. The compilation fails.


B. abdf
C. abd
D. adf
E. abcd

Answer: E

NEW QUESTION 95
Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. 42
B. The compilation fails due to an error in line 4.
C. 17
D. The compilation fails due to an error in line 3.
E. The compilation fails due to an error in line 2.
F. The compilation fails due to an error in line 1.
G. The compilation fails due to an error in line 5.

Answer: A

NEW QUESTION 100


Which two modules include APIs in the Java SE Specification? (Choose two.)

A. java.logging
B. java.desktop
C. javafx
D. jdk.httpserver
E. jdk.jartool

Answer: AD

NEW QUESTION 104


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?

A. MessageBundle_en_US.properties
B. MessageBundle_en.properties
C. MessageBundle_fr_FR.properties
D. MessageBundle_US.properties
E. MessageBundle.properties

Answer: C

NEW QUESTION 107


Given:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

What is the result?

A. nothing
B. 10
C. 0 4 9

Answer: A

NEW QUESTION 112


Given:

and

What is the result?

A. A NullPointerException is thrown at run time.


B. The compilation fails.
C. 1Null null
D. 111
E. A ClassCastException is thrown at run time.

Answer: B

Explanation:

NEW QUESTION 115


Given this enum declaration:

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Examine this code: System.out.println(Alphabet.getFirstLetter());


What code should be written at line 3 to make this code print A?

A. final String getFirstLetter() { return A.toString(); }


B. static String getFirstLetter() { return Alphabet.values()[1].toString(); }
C. static String getFirstLetter() { return A.toString(); }
D. String getFirstLetter() { return A.toString(); }

Answer: C

NEW QUESTION 120


......

Your Partner of IT Exam visit - https://www.exambible.com


We recommend you to try the PREMIUM 1Z0-819 Dumps From Exambible
https://www.exambible.com/1Z0-819-exam/ (175 Q&As)

Relate Links

100% Pass Your 1Z0-819 Exam with Exambible Prep Materials

https://www.exambible.com/1Z0-819-exam/

Contact us

We are proud of our high-quality customer service, which serves you around the clock 24/7.

Viste - https://www.exambible.com/

Your Partner of IT Exam visit - https://www.exambible.com


Powered by TCPDF (www.tcpdf.org)

You might also like