nerdexam
Oracle

1Z0-804 · Question #3

Given: What is the result?

The correct answer is A. false false. (this == obj) is the object implementation of equals() and therefore FALSE, if the reference points to variousobjectsand then the super.equals() is invoked, the object method equals() what still result in FALSEbetter override of equals() is to compare the attributes like…

RAC Architecture

Question

Given:

What is the result?

Exhibit

1Z0-804 question #3 exhibit

Options

  • Afalse false
  • Btrue false
  • Ctrue true
  • DCompilation fails
  • EAn exception is thrown at runtime

How the community answered

(45 responses)
  • A
    80% (36)
  • B
    2% (1)
  • C
    2% (1)
  • D
    11% (5)
  • E
    4% (2)

Explanation

(this == obj) is the object implementation of equals() and therefore FALSE, if the reference points to variousobjectsand then the super.equals() is invoked, the object method equals() what still result in FALSEbetter override of equals() is to compare the attributes like: public boolean equals (Object obj) { if (obj != null){ Product p = (Product)obj; return this.id == p.id;

Topics

#Java boolean expressions#operator evaluation#output prediction

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice