Abstract Class

Hi, i would really appreciate some help on this.. Thanks in advance

I have the following abstract class

public abstract class Number extends SExpression

{

privateint _theNumber;

privatedouble _theReal;

publicint intValue(){return _theNumber;}

publicdouble realValue(){return _theReal;}

public SExpression eval(Environment env){returnthis;}

}

I have another 2 classes that extend the Number class above,

namely INT and Real

Finally the other abstract class i have a problem with called Arithmetics has this method:

public Number plus(Environment env)throws Exception{

SExpression carResult = this.car().eval(env);

if (carResult.numberP() )

{

returnnew [b]Number[/b]( ((Number)carResult).intValue() + ((Number)this.cdr().plus(env)).realValue() );

}

I want to return a new "Number" object but i get the error message that Number is an abstract class and cannot be instantiated

What can i do to solve this problem?

[1934 byte] By [RelCoa] at [2007-11-27 2:39:18]
# 1
Simple, remove the abstract keyword. The fact that you want to instantiated (possibly mistakenly) tells me that it's not an abstract class.PS.
puckstopper31a at 2007-7-12 3:01:12 > top of Java-index,Java Essentials,Java Programming...