what does this provein stacktriangle java (listing we have program that more or less systematically transforms program that uses recursion into program that uses stack this suggests that such transformation is possible for any program that uses recursionand in fact this is the case with some additional workyou can systematically refine the code we show heresimplifying it and even eliminating the switch statement entirely to make the code more efficient in practicehoweverit' usually more practical to rethink the algorithm from the beginningusing stack-based approach instead of recursive approach listing shows what happens when we do that with the triangle(method listing the stacktriangle java program /stacktriangle java /evaluates triangular numbersstack replaces recursion /to run this programc>java stacktriangle app import java io */for / ///////////////////////////////////////////////////////////////class stackx private int maxsize/size of stack array private int[stackarrayprivate int top/top of stack //public stackx(int /constructor maxsize sstackarray new int[maxsize]top - //public void push(int /put item on top of stack stackarray[++topp//public int pop(/take item from top of stack return stackarray[top--]//public int peek(/peek at top of stack return stackarray[top]/