Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: vector problem


Message #1 by "Preeti" <preetisikri@h...> on Wed, 28 Feb 2001 18:31:27 -0500
Hi,
You are passing the parameter int where you supposed to pass object.

vishwa

>From: "Preeti" <preetisikri@h...>
>Reply-To: "Pro_JavaServer_Pages" <pro_jsp@p...>
>To: "Pro_JavaServer_Pages" <pro_jsp@p...>
>CC: <javacertstudy@y...>,	"A mailing list about Java Server 
>Pages specification and             reference" 
><JSP-INTEREST@j...>,	<AJUG-SCPJava2@y...>
>Subject: [pro_jsp] vector problem
>Date: Wed, 28 Feb 2001 18:31:27 -0500
>
>Hey guys
>Ple 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 = new Vector();
>       }
>
>   public String addtocart(int id)
>   {
>     if(id > 0)
>     {
>       list.addElement(new int(id));
>     }
>
>     return "added to vector";
>   }
>}
>
>
>pls help
>Regards Preeti
>
>

  Return to Index