object
JAVA
Two stacks are the same if they have the same size and their elements at the corresponding positions are the same. Add the method equalStack to Class StackClass that takes as a parameter a StackClass object, say otherStack and return true if the stack is the same as otherStack. Also write the definition of method equalStack and a program to test your method. In StackClass.java, please finish method - public boolean equalStack(StackClass<T> otherStack) and testing main program – Problem52.java. (Download Problem52.zip to complete this problem)
/*Problem52
public class Problem52
{
public static void main(String[] args)
{
StackClass<Integer> intStack = new StackClass<Integer>(50);
StackClass<Integer> tempStack = new StackClass<Integer>(50);
}
}
*/
Step by step
Solved in 2 steps with 1 images