I have a stack method that's supposed to return a reversed copy of the this object. I need this to link this to that, the reversed copy of the this stack. Thanks
public FancyStack<E> reversed()
{
FancyStack<E> that= new FancyStack<E>();
if(this.isEmpty()){
return this;
}
else{
while(top!=null)
{
revertStack.push(pop());
}
}
return revertStack;
}