dcsimg

How do you store a primitive data type within a Vector or other collections class?

John Zukowski

You need to wrap the primitive data type into one of the wrapper classes found in the java.lang package, like Integer, Float, or Double, as in:

Integer in = new Integer(5);