expressionvariable (for variablesand expressionoperator (for operatorsin turnclass expressionoperator has subclasses for the arithmetic operatorssuch as additionoperator and multiplicationoperator method value of expressionterm is overridden by its subclasses for variableit returns the value of the variable for an operatorit returns the result of applying the operator to its operands the operands of an operator are set by method setoperands of expressionoperator in code fragment we show the classes expressiontermexpressionvariableexpressionoperator and additionoperator code fragment classes for variablegeneric operatorand addition operator of an arithmetic expression