Question: is the following implementation correct ? how can it be fixed or is correct ? public String toString() { String result = ; while (!stack.isEmpty())
public String toString() { String result = ""; while (!stack.isEmpty()) { result += top.getElement(); top = top.getNext(); } return result; 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
