I have a list which will store Number objects. The list will be populated by parsing a list of strings, where each string may represent any subclass of Number.
How do I parse a string to a generic number, rather than something specific like an integer or float?
Number cannot be instantiated because it is an abstract class. I would recommend passing in Numbers, but if you are set on Strings you can parse them using any of the subclasses,
or
@See NumberFormat