I have seen questions like Java Generics and adding numbers together frequently and the answer usually boils down to the fact that you can't really do anything with Number
itself.
The Sourcecode shows that Number
is mostly an empty shell unlike for an example Object.
At this point I can't think of a situation where using Number
instead of a concrete subtype has significant (if any) advantages. Usually I start out with Number
but run into problems later on actually using it and change it to a subtype anyway. But this may just be my limited experience.
So I am wondering, what is the purpose of this class other then being a common ancestor of other numeric types with no real functionality?