Question: 6 . When you have finished verifying the array - based stack uses exceptions correctly, you will move on to the reverseString and doBracketsMatch methods
When you have finished verifying the arraybased stack uses exceptions correctly, you will move on
to the reverseString and doBracketsMatch methods in LabTester.java. For each method
one at a time do the following:
a Uncomment the code within the method you are working on
b Determine which method calls on the stack are calling a method that throws an exception.
c Wrap all such calls in a trycatch block.
d Within the exception catch block, add appropriate code for the logic of the method. That is
if pop is called on an empty stack, what should be done in the catch block? What happens in
the reverseString methods catch block is likely different than it is in doBracketsMatch?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
