Oracle Certified Professional Java Se 11 Developer · Free Practice Question Hard

Question 28

Question ID: UKOCP55895


What will be the result of compiling and executing Test class?

  • A Compilation error at Line n3
  • B Compilation error at Line n4
  • C

    true

    true

  • D

    false

    false

Reveal correct answer

Correct answer: B

Explanation

UKOCP55895:

enums JobStatus and TestResult are siblings as both implicitly extend from java.lang.Enum class.


Siblings cannot be compared using double equals operator (==).


equals(Object) method accepts any instance which Object can refer to, which means all the instances.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need