Originally posted by Steven Young: Option 4 is the only one that adds an Object. All other options are adding a primitive integer. Collections can only have objects, so primitives need to be wrapped in an object,
Right..But due to autoboxing feature in SCJP 5.0 .. will option 3 not be valid as well?
addElement is a method only of Vector class, not of List. I've not understood the difference between the two methods add - addElement. Is it just the return type (boolean for add(E o), void for addElement(E obj)). When is it advisable to use addElement? Thanks