The description of Object class equal method says for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).
The above code displays true. o1 and o2 refer 2 different objects. inside equals method we have code "return this==obj" .when o1 and o2 refer different objects == should return false. but why i am getting true?
how the equals method of object different from equals method of String?