1. If you want to add an element of type int into a vector, just use one of the methods. Casting the int into an object is not necessary when you are sending the integer type variable in as a argument for the add method. BUT DO NOTE: 2. If the method you are using RETURNS something of type OBJECT, for example, elementAt(int ), you need to cast the OBJECT into int, assuming you want it the elementAt(int) to return an int.(or whatever type you want) |