1z0-811Free trialFree trial

By oracle
Aug, 2025

Verified

25Q per page

Question 1

Which statement is true about primitive variables?

  • A: They can be compared with the == operator.
  • B: They can be compared with the equals method only.
  • C: They cannot be compared.
  • D: They can be compared with the compareTo method only.

Question 2

Given the code fragment:

Image 1

Which code fragment, when inserted at line n1, enables the code to print Java Programming:1?

  • A: System.out.println(name + “:” + count);
  • B: System.out.println(c.name + “:” + count);
  • C: System.out.println(c.name + “:” + Course.count);
  • D: System.out.println(Course.name + “:” + c.count);

Question 3

Given:

Image 1

Why does the compilation fail?

  • A: The option variable is not initialized.
  • B: The order of case labels is incorrect.
  • C: The option data type is incorrect.
  • D: The break statement is missing.

Question 4

Given:

Image 1

What is the result?

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

Question 5

Which two Java reserved words are used to implement encapsulation?

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

Question 6

Given the code fragment:

Image 1

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();

Question 7

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.

Question 8

Identify two features of Java.

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

Question 9

Given:

Image 1

What is the result?

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

Question 10

Given the code fragment:

Image 1

What is the result?

  • A: A compilation error occurs.
  • B: A runtime exception is thrown.
  • C: Julia - Peter
  • D: Peter - Julia

Question 11

Given the code fragment:

Image 1

What is the result?

  • A: 9 12
  • B: 10 10
  • C: 9 9
  • D: 10 14

Question 12

Given the code fragment:

Image 1

What is the result?

  • A: 2
  • B: 4
  • C: The program executes an infinite number of times.
  • D: 3

Question 13

Given the code fragment:

Image 1

What is the result?

  • A: Unknown issues. Invalid divisor.
  • B: Unknown issues.
  • C: Invalid divisor.
  • D: A compilation error occurs.

Question 14

Given the code fragment:

Image 1

What is the result?

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

Question 15

Given the code fragment:

Image 1

What is the result?

  • A: Selected null flavor.
  • B: Selected Chocolate flavor.
  • C: An ArrayIndexOutofBoundsException is thrown at run time.
  • D: Selected Chocolate flavor. Thank you!

That’s the end of your free questions

You’ve reached the preview limit for 1z0-811

Consider upgrading to gain full access!

Page 1 of 3 • Questions 1-25 of 71

Free preview mode

Enjoy the free questions and consider upgrading to gain full access!