by Kanchanok Kannee
-
Object.equals to check It is the position in same memory. In an example of the "Cat" but declared that different position. It is stored in the different memory. Its value is “false”. Then go into the method of testPersonEquals of Person class have a same name ,Cat (true).But testObjectEquals It is to do with the object. Because of this, it is false The solution should be true.
-
output true because only checks for the name so this returned true.The result should be 'false'. Person is not same as Student because different classes.