Head first EJB book page 292 question 6: According to basic Java rules if two objects are equals(), they are similar, identical but may not be the same. If two objects are == then they are same. Am I correct? Then the answer for this question should be A. Am I missing something? Please help! Thank you very much. [ March 07, 2004: Message edited by: Nesan Krish ]
If object1 == object2 returns true, they reference to the same object. But if object1 == object2 returns false, the objects may still refer to the same entity (i.e. the primary key objects contain the same data which implies that equals-method returns true). Thus, only B is correct.
posted 16 years ago
Does this mean that two seperate primary keys can point one entity?