Question: Modify the Stack ADT implementations Utilizing your Stack ADT implementations: Implement the methods specified for the bounded stack (ArrayStack) Add an inspector method inspector(int loc).
Modify the Stack ADT implementations Utilizing your Stack ADT implementations: Implement the methods specified for the bounded stack (ArrayStack) Add an inspector method inspector(int loc). The method will return the element found at the location loc. Return null if the location is invalid. Implement popSome(int count). The method will remove the top count items from the stack. The method should throw a StackUnderFlow Exception as needed. Note that you will have some room for decisions in this method. Document your approach in the comments. Without adding any new instance variables, implement a size() method. The method will return an integer value indicating the number of elements in the stack. ** These methods will not be part of the StackInterface or the BoundedStackInterface. You dont need to define them in the interface declarations.
package ch03; public class ArrayStack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
