oracle 1Z0-819 Exam Questions

Questions for the 1Z0-819 were updated on : Nov 26 ,2024

Page 1 out of 15. Viewing questions 1-15 out of 214

Question 1

Given:

What is the result?
A. nothing
B. It fails to compile.
C. 0
D. A java.lang.IllegalArgumentException is thrown.
E. 10

Answer:

B

Discussions
0 / 1000

Question 2

Given:

Which two changes need to be made to make this class compile? (Choose two.)

  • A. Change Line 1 to an abstract class:public abstract class API {
  • B. Change Line 2 access modifier to protected:protected void checkValue(Object value)throws IllegalArgumentException;
  • C. Change Line 1 to a class:public class API {
  • D. Change Line 1 to extend java.lang.AutoCloseable:public interface API extends AutoCloseable {
  • E. Change Line 2 to an abstract method:public abstract void checkValue(Object value)throws IllegalArgumentException;
Answer:

C,E

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 3

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:

A,D

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Reference: https://docs.oracle.com/javase/9/docs/api/overview-summary.html

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 4

Given:

What is the output?
A. 300
B. Exception
C. 200
D. 100

Answer:

A

Discussions
0 / 1000

Question 5

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:

A, C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

Given the code fragment:

What is the result?

  • A. -1 : 2
  • B. 2 : -1
  • C. 2 : 3
  • D. 3 : 0
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

Given:

What is the result?

  • A. The compilation fails.
  • B. abdf
  • C. abd
  • D. adf
  • E. abcd
Answer:

E

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 8

Which set of commands is necessary to create and run a custom runtime image from Java source
files?

  • A. java, jdeps
  • B. javac, jlink
  • C. jar, jlink
  • D. javac, jar
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Reference:
https://blogs.oracle.com/jtc/automating-the-creation-of-jdk9-reduced-runtime-images-
in-netbeans

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

Given:

What is the result?
A. 4
B. 3
C. An exception is thrown at runtime.
D. 5

Answer:

D

Discussions
0 / 1000

Question 10

Given:

It is required that if p instanceof Pair then p.isValid() returns true.

Which is the smallest set of visibility changes to insure this requirement is met?

  • A. setLeft and setRight must be protected.
  • B. left and right must be private.
  • C. isValid must be public.
  • D. left, right, setLeft, and setRight must be private.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

Given:

What is the result?

  • A. 5
  • B. 3
  • C. 23
  • D. 25
  • E. 11
Answer:

E

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 12

Given:


What is the result?
A. 2,34,34,5
B. 2,34,54,5
C. 2,54,54,5
D. 2,34,54,3

Answer:

C

Discussions
0 / 1000

Question 13

Given:

What is the result?

  • A. It throws a runtime exception.
  • B. Value of Euler = 2.71828
  • C. The code does not compile.
  • D. Value of Euler = “2.71828”
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

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

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 15

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

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000
To page 2