Question: how vector works in java?
Answer: Internally, Vector just stored objects as type Object. ... To cope with them, Java will convert them from primitive values to Objects on the fly, as needed. So the int 5 will be converted to an Integer object holding 5, and the double 4.3 will be converted to a Double object holding 4.3.