The problem with the general is that at run time it does not have a specific type. It's just an Object class, which means that creating such an object is completely pointless, because in fact you would just create an object of type Object .
However, you can create such objects outside the class, because the real type of the object ( Double ) is known here. So, I would suggest using some sort of List , which can be dynamic, to preserve the values.
qwertz
source share