@@ -0,0 +1,1284 @@
+package edu.java;%0A%0A/*%0A * start a new stack when the previous stack exceeds some threshold%0A * implement a data structure setofstacks that mimics this.SetOfStacks should be composed of several stacks, and should %0A * create a new stack once the previous one exceeds capacity SetOfStacks push() and SetOfStacks pop() should behave %0A * identically to a single stack (that is, pop() should return the same values as it would if there were just a %0A * single stack)%0A * %0A */%0Apublic class StackPlates %7B%0A%0A%09/**%0A%09 * @param args%0A%09 */%0A%09public static void main(String%5B%5D args) %7B%0A%09%09stack st = new stack();%0A%09%09stack temp = new stack();%0A%09%09temp.push(1);%0A%09%09st.push(temp);%0A%09%09%0A%09%09Stacks s1 = new Stacks(st);%0A%09%09s1.push(2);%0A%09%09System.out.println(s1.pop());%0A%0A%09%7D%0A%7D%0A%0Aclass Stacks%7B%0A    stack st;%0A    int pos;%0A    int capacity = 10;%0A    %0A    public Stacks(stack st)%7B%0A    %09this.st = st;%0A    %09pos = 0;%0A    %7D%0A    %0A    Object pop()%7B%0A        if(st.top!=null)%7B%0A        %09  stack target = (stack)st.peek();%0A        %09  Object item = target.pop();%0A        %09  return item;%0A        %7D%0A        return null;%0A    %7D%0A    %0A    void push(Object item)%7B%0A    %09if(pos==capacity-1)%7B%0A    %09%09stack temp = new stack();%0A    %09%09st.push(temp);%0A    %09%09temp.push(item);%0A    %09%7D%0A    %09else%7B%0A    %09%09((stack) st.peek()).push(item);%0A    %09%09pos++;%0A    %09%7D%0A    %7D%0A%7D%0A

Create stackplates.java