Question: 1.2 Implement the method clear) of the class ArrayStack The class ArrayStack uses an array of fixed size and implements the interface Stack. Since the



1.2 Implement the method clear) of the class ArrayStack The class ArrayStack uses an array of fixed size and implements the interface Stack. Since the interface Stack has been modified to have the method clear), the implementation of the class ArrayStack is faulty. (Try to compile it now without changing anything, what error do you see?). Since the class ArrayStack implements the interface Stack, it needs to have an implementation for all methods of the interface. Therefore, you will need to write a method void clear0). This method will remove all the elements from this stack (ArrayStack). The stack will be empty after this call. Use the class L6Q1 to test the implementation of the method clear() Files: ArrayStack.java L6Q1.java public class ArrayStack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
