oracle 1z0-811 practice test

Exam Title: Java Foundations

Last update: Nov 27 ,2025
Question 1

Given:

What is the result?

  • A. [null:-]
  • B. [ : ]
  • C. [null:null]
  • D. [:null]
Answer:

A

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 2

Which two Java reserved words are used to implement encapsulation?

  • A. final
  • B. static
  • C. public
  • D. extends
  • E. private
Answer:

C, E


Explanation:
Reference: https://learn.saylor.org/mod/page/view.php?id=22044

vote your answer:
A
B
C
D
E
A 0 B 0 C 0 D 0 E 0
Comments
Question 3

Given the code fragment:

Which code fragment can be inserted at line n1 to enable the code to print 0.0?
A.
Ball b = null;
b.weight = 0.0;
B.
Ball.weight = 0.0;
C.
Ball b = new Ball(0.0);
D.
Ball b = new Ball();

Answer:

D

vote your answer:
Comments
Question 4

Which two statements are true about the Java Runtime Environment (JRE)?

  • A. It is responsible for garbage collection.
  • B. It interprets bytecode stored in a .class file.
  • C. It contains the JDK and Java APIs.
  • D. It is platform independent.
  • E. You must install the JRE to compile a .java file.
Answer:

B, D


Explanation:
Reference: https://en.wikipedia.org/wiki/Java_virtual_machine

vote your answer:
A
B
C
D
E
A 0 B 0 C 0 D 0 E 0
Comments
Question 5

Identify two features of Java.

  • A. architecture dependent
  • B. platform independent
  • C. single threaded
  • D. robust
Answer:

B, D


Explanation:
Reference: https://www.javatpoint.com/features-of-java

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 6

Given:

What is the result?

  • A. 300
  • B. 100
  • C. 200
  • D. A compilation error occurs.
Answer:

D

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 7

Given the code fragment:

What is the result?
A.
A compilation error occurs.
B.
A runtime exception is thrown.
C.
Julia
Peter
D.
Peter
Julia

Answer:

C

vote your answer:
Comments
Question 8

Given the code fragment:

Which code fragment can be inserted at line n1 to enable the code to compile?

  • A. new int num[];
  • B. int[] num;
  • C. int[10] num;
  • D. int num[10];
Answer:

B

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 9

Given the code fragment:

What is the result?
A.
B.
C.
D.

Answer:

B

vote your answer:
Comments
Question 10

Given the code fragment:

What is the result?
A.
Unknown issues.
Invalid divisor.
B.
Unknown issues.
C.
Invalid divisor.
D.
A compilation error occurs.

Answer:

D

vote your answer:
Comments
Page 1 out of 7
Viewing questions 1-10 out of 75
Go To
page 2