oracle 1Z0-811 Exam Questions

Questions for the 1Z0-811 were updated on : Dec 01 ,2025

Page 1 out of 5. Viewing questions 1-15 out of 75

Question 1

Given the contents of the Test.java file:

What is the result?

  • A. 200 : 400
  • B. A compilation error occurs at line n1.
  • C. A compilation error occurs at line n2.
  • D. 100 : 400
Answer:

C

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

Question 2

Given:

What is the result?

  • A. The program compiles and nothing is printed.
  • B. Iteration plus an increasing number is printed 100 times.
  • C. Iteration plus an increasing number is printed 99 times.
  • D. An error occurs during compilation.
Answer:

D

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

Question 3

Given:

What is the output?

  • A. 1 2 3 aaaa
  • B. 1 2 aaa
  • C. Compilation fails
  • D. a
Answer:

D

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

Question 4

Which two components can class declarations include?

  • A. A list of instance methods
  • B. The main method
  • C. Interfaces implemented by the class
  • D. The public modifier
Answer:

C, D

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

Explanation:
Reference: https://docs.oracle.com/javase/tutorial/java/javaOO/classdecl.html

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

Question 5

Which package would you import to use the Random class?

  • A. java.io
  • B. java.math
  • C. java.util
  • D. java.lang
Answer:

C

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

Explanation:
Reference: https://www.educative.io/edpresso/how-to-generate-random-numbers-in-java

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

Question 6

Given the code fragment:

What is the result?

  • A. A compilation error occurs at line n1.
  • B. Jack
  • C. The program prints either Jack or Queen.
  • D. Queen
Answer:

A

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

Question 7

Given the code fragment:

What is the result?
A.
a memory address1 in hexadecimal number format
a memory address2 in hexadecimal number format
B.
10, 15
[10, 15]
C.
0, 10, 15
[10, 15, null]
D.
a memory address in hexadecimal number format
[10, 15]

Answer:

D

User Votes:
Discussions
vote your answer:
0 / 1000

Question 8

Given the code fragment:

What is the output?

  • A. 8
  • B. 3
  • C. 0
  • D. A compilation error occurs.
Answer:

C

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

Question 9

Given the code fragment:

What is the result?

  • A. lotus jasmine
  • B. lotus
  • C. A compilation error occurs.
  • D. lotus lily
Answer:

D

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

Question 10

Given the code fragment:

What is the result?
A.
false
true
B.
true
true
C.
false
false
D.
A runtime exception is thrown

Answer:

B

User Votes:
Discussions
vote your answer:
0 / 1000

Question 11

Identify three features of the Java programming language.

  • A. distributed
  • B. direct memory management
  • C. multithreaded
  • D. strongly typed
  • E. dynamically typed
Answer:

A, C, E

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

Explanation:
Reference: https://www.tutorialspoint.com/What-are-the-major-features-of-Java-programming

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

Question 12

Given the code fragment:

What is the result?

  • A. 25.67
  • B. 25.00
  • C. 25.7
  • D. 26
Answer:

A

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

Question 13

Identify three advantages of object-oriented programming.

  • A. separation of state and behavior
  • B. modularity
  • C. information sharing
  • D. code reuse
  • E. information hiding
Answer:

B, D, E

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

Explanation:
Reference:
https://www.tutorialspoint.com/object_oriented_analysis_design/ooad_quick_guide.htm

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

Question 14

Given the code fragment:

What is the result?

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

B

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

Question 15

Given the code fragment:

Which statement, when inserted at line n1, enables the code to print 0 2 4 6 8 10?

  • A. count = (count++) +1;
  • B. count = count++;
  • C. count =+ 2;
  • D. count += 2;
Answer:

D

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