Oracle 1z0-811 Exam (page: 1)
Oracle Java Foundations
Updated on: 12-Aug-2025

Viewing Page 1 of 16

Which statement is true about primitive variables?

  1. They can be compared with the == operator.
  2. They can be compared with the equals method only.
  3. They cannot be compared.
  4. They can be compared with the compareTo method only.

Answer(s): B


Reference:

https://stackoverflow.com/questions/9690981/compare-two-primitive-long-variables-in-java



Given the code fragment:



What is the result?

  1. 2
  2. 4
  3. The program executes an infinite number of times.
  4. 3

Answer(s): B

Explanation:



Identify two Java reserved words.

  1. array
  2. true
  3. this
  4. exception
  5. string

Answer(s): B,C


Reference:

https://www.computerhope.com/jargon/j/java_reserved_words.htm



Which statement is true about a Java method?

  1. It must be declared with an access modifier.
  2. It cannot be defined within another method.
  3. It must accept a parameter and return a value.
  4. It cannot be defined as static final.

Answer(s): B


Reference:

https://www.quora.com/Can-we-define-a-function-within-another-function-in-Java



Given:


And the code fragment:


Which code fragment can be inserted at line n1 to enable the code to print All the best?

  1. void writeMsg();
  2. Messenger.writeMsg();
  3. writeMsg();
  4. m.writeMsg();

Answer(s): B



Viewing Page 1 of 16



Share your comments for Oracle 1z0-811 exam with other users:

CesarPA 7/12/2023 10:36:00 PM

questão 4, segundo meu compilador local e o site https://www.jdoodle.com/online-java-compiler/, a resposta correta é "c" !
UNITED STATES


Maria 6/23/2023 11:40:00 AM

correct answer is d for student.java program
IRELAND