Consider the following classes:
The class AlgExpr represents algebraic expressions, including prefi x, postfi x, and infi x expressions. Its method isExpression simply examines the expression for valid characters but does not consider the order of the characters. The class InfixExpr represents infi x expressions. Its isExpression calls isBlank , and its display calls valueOf .
a. Should isBlank be public, protected, or private? Explain.
b. If inExp is an instance of InfixExpr in the main method, can inExp invoke endExpression ? Explain.
c. What small change(s) would you make to the classes to ensure that the correct version of isExpression is called?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here