I have often come across questions such as Java Generics and adding numbers together , and the answer usually comes down to the fact that you cannot do anything with help Numberon its own.
The source code shows that Numberit is basically an empty shell, unlike the Object example.
At this moment, I cannot imagine a situation where using Numberinstead of a specific subtype has significant (if any) advantages. I usually start with Number, but run into problems later, actually use it and change it to a subtype anyway. But this can only be my limited experience.
So, I wonder, what is the purpose of this class, which then is the common ancestor of other number types without real functionality?
source
share