Amandeep Singh wrote:My main concern is to check is there any other best approach to check whether this object is a Number or not.
If I looked at your code, I would conclude that your main concern was to tell whether the values of two Number objects were equal. But if your main concern is really to check whether an object is a Number, then
is the answer. That's all you need. All of that other code you posted is superfluous.
Joined: Oct 13, 2005
Amandeep Singh wrote:
all such methods can cause problems with sub-classes