Originally posted by anmita payal: ...Means what I understood from API is It will return true if Objects are of same type. I got one more doubt is here when we are aomparing Objects it is checking the values and not references....
For the wrapper classes, that's correct. The objects must be the same type and hold the same values. The references do not matter.
This is the kind of implementation we would expect for equals. But keep in mind that equals can be overridden differently in each class. And without any overriding, a class inherits the implementation in Object, which works more like a comparison of references.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org