Java OCA OCP Practice Question 595

Question

Suppose ob1 and ob2 are references to instances of java.lang.Object.

If (ob1 == ob2) is false, can ob1.equals(ob2) ever be true?

  • A. Yes
  • B. No


B.

Note

The Object class' equals() method just does an == check, so if (ob1 == ob2) is false, then ob1.equals(ob2) will always be false.




PreviousNext

Related