Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Re: got the anser for : vector problem


Message #1 by "Preeti" <preetisikri@h...> on Wed, 28 Feb 2001 19:08:40 -0500
This is a multi-part message in MIME format.

------=_NextPart_000_0054_01C0A1B9.DC4C8D40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hey guys
I got the answers of my problem pls do not waste your time on this 
problem now
Thanks Preeti
  ----- Original Message -----
  From: M. en C. Jes=FAs Sosa Iglesias
  To: Pro_JavaServer_Pages
  Sent: Wednesday, February 28, 2001 6:21 PM
  Subject: [pro_jsp] Re: vector problem


   
  To add an element to a list,  You need a Java Object (Integer) not a 
basic type (int)
  By ex. you need to use :
        list.addElement(new Integer(id));

  Preeti wrote:

    Hey guysPle tell where is the problem in the following code and how 
can i solve that ..i'm getting the following error : class required, but 
int found at line 17, column 30 my code is : - import java.util.*; 
public class cart{     Vector list;   public cart(){
          list =3D new Vector();
          }   public String addtocart(int id)
      {
        if(id > 0)
        {
     
     
          list.addElement(new int(id));
        }     return "added to vector";
      }
    }  
    pls helpRegards Preeti---
$subst('Email.Unsub')

$subst('Email.Unsub')



  Return to Index