Hi! I was writing a calculator to practice my programming skills and I really cannot solve a problem with an abstract class
//base class for all tokens
public abstract class BaseToken
{
public override string ToString() {
return tokenValue;
}
}
//base class for all operators
public abstract class Operators:BaseToken {
protected char tokenValue;
}
//numbers
public class number : BaseToken {
protected int tokenValue;
public number(int val) {
tokenValue = val;
}
}
problem here is that I implement "tokenValue" varaible in sub-classes of baseToken class but I want to use it in base class but it gives me error (the name 'tokenValue' does not exist in the current context) what can I do to solve that problem. thank you!