Error on adding object to arrayList

Hello sirs,

I have problem with adding element of type object to an arrayList.

This is the error Iam getting

symbol : method add(syntaxtree.Exp)

location:class java.lang.Object

{yyrv=yysv[yysp-1].add(((Exp)yysv[yysp-2])); yyrv = yysv[yysp-1];}

[/code

The code is

[code]

VarDecList:VarDec VarDecRest{$$=$2.add($1); $$ =$2;}

;

VarDecRest:';'VarDec{$$=$2;}|{$$=new VarDecList();}

;

Iam really stacked can anyone help me.

I will appreciate for your help

[846 byte] By [uddessjavaa] at [2007-11-26 13:16:49]
# 1

> Hello sirs,

> I have problem with adding element of type object to

> an arrayList.

> This is the error Iam getting

> [code]

> symbol : method add(syntaxtree.Exp)

> location: class java.lang.Object

> {yyrv=yysv[yysp-1].add(((Exp)yysv[yysp-2]));

> yyrv = yysv[yysp-1];}

> /code

> The code is

>

> e]

> VarDecList:VarDec VarDecRest

>

> $$=$2.add($1); $$ =$2;}

>

> $$=$2;}

>

>{$$=new VarDecList();}

> e]

>

> Iam really stacked can anyone help me.

> I will appreciate for your help

This is Java code?

Try reposting with the [code] tags in the correct spot - use the preview button to view before posting.

jbisha at 2007-7-7 17:39:44 > top of Java-index,Java Essentials,New To Java...
# 2
Thanks jbish .Ok,it is jacc code.sorry for not making it clear.But Just want to your help on adding element on an arrayList.cause used the add method but getting the mentioned error.Thanks again
uddessjavaa at 2007-7-7 17:39:44 > top of Java-index,Java Essentials,New To Java...
# 3

> Thanks jbish .

> Ok,it is jacc code.sorry for not making it clear.

> But Just want to your help on adding element on an

> arrayList.

> cause used the add method but getting the mentioned

> error.

> Thanks again

Could you post the exact error message again - or am I just not seeing it (don't know jacc).

jbisha at 2007-7-7 17:39:44 > top of Java-index,Java Essentials,New To Java...