Java OCA OCP Practice Question 1988

Question

Which statement is true?.

Select the one correct answer.

  • (a) If the references x and y denote two different objects, the expression x.equals(y) is always false.
  • (b) If the references x and y denote two different objects, the expression (x.hashCode() == y.hashCode()) is always false.
  • (c) The hashCode() method in the Object class is declared final.
  • (d) The equals() method in the Object class is declared final.
  • (e) All arrays have a method named clone.


(e)

Note

All arrays are genuine objects and inherit all the methods defined in the Object class, including the clone() method.

Neither the hashCode() method nor the equals() method is declared final in the Object() class, and it cannot be guaranteed that implementations of these methods will differentiate between all objects.




PreviousNext

Related