Hello,
I'm having troubles using Vectors. Basically, I am being forced to use Vectors as a way of storing a list of doubles.
i want to be able to do the following:
But apparently this won't work because Vectors store Object, and ?doubles are not objects?Code:Vector myVector = new Vector(); double mydouble = 0.5; myVector.add(mydouble);
So I do this:
But if I do this, how do I later retrieve the double's from the Vector?Code:myVector.add(new Double(mydouble))
I want to say:
But that doesn't workCode:newdouble = myVector(0);//assuming that mydouble was stored at index 0
Please help!
Alex




Reply With Quote