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...


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?

Nov 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here