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?

