File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes int and Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "int and Vector" Watch "int and Vector" New topic

int and Vector

Naveen R R

Joined: May 04, 2001
Posts: 20
Could anyone please help me with this? I get the following error when I try to add an int to a vector.
The method addElement invoked for type java.util.Vector with arguments () is not defined.
int persNbr = new Integer(roleAssign.getPersNbr()).intValue();
Thank you,
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
Well of course, Vector can only hold reference variables, not primitives. You should just:
Integer iObj = new Integer(roleAssign.getPersNbr()) ;
input.addElement( iObj );
subject: int and Vector
It's not a secret anymore!